nutella_framework 0.4.23 → 0.4.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/framework_components/monitoring-bot/monitoring-bot.rb +11 -2
- data/framework_components/monitoring-interface/.gitignore +2 -0
- data/framework_components/monitoring-interface/README.md +1 -0
- data/framework_components/monitoring-interface/bower.json +29 -0
- data/framework_components/monitoring-interface/bower_components/bower-mqttws/.bower.json +23 -0
- data/framework_components/monitoring-interface/bower_components/bower-mqttws/bower.json +14 -0
- data/framework_components/monitoring-interface/bower_components/bower-mqttws/mqttws31.js +2081 -0
- data/framework_components/monitoring-interface/bower_components/bower-mqttws/readme.md +4 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/.bower.json +37 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/LICENSE +21 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/README.md +15 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/bower.json +28 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/browser/mqtt_client_hello_world.html +23 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/browser/nutella_hello_world.html +52 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/node/mqtt_client_hello_world.js +14 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/node/nutella_hello_world.js +38 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/nutella_lib.js +789 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/package.json +30 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface.html +215 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/animations.js +27 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/application-view-controller.js +232 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js +61 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/bootstrap.min.js +7 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/cursor.css +7 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/d3.v3.min.js +5 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/graphics.js +156 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/grid-layout.js +103 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/highlight.min.js +2 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/instance-view-controller.js +104 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/jquery-1.10.0.min.js +6 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/notification-center.js +63 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/notifications.js +14 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/page.css +33 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/radial-layout.js +175 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/tab-table.js +8 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-application.css +0 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-application.js +320 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-connection-view.css +10 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-connection-view.js +426 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-element.js +205 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-notification.js +94 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-tab.js +229 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/underscore-min.js +5 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js +68 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/window-view-controller.js +169 -0
- data/framework_components/monitoring-interface/css/alerts.css +3 -0
- data/framework_components/monitoring-interface/css/bootstrap.min.css +5 -0
- data/framework_components/monitoring-interface/css/cursor.css +7 -0
- data/framework_components/monitoring-interface/css/highlight.default.min.css +1 -0
- data/framework_components/monitoring-interface/css/page.css +41 -0
- data/framework_components/monitoring-interface/css/ui-application.css +0 -0
- data/framework_components/monitoring-interface/css/ui-connection-view.css +10 -0
- data/framework_components/monitoring-interface/css/ui-legend-view.css +7 -0
- data/framework_components/monitoring-interface/data/alert.json +8 -0
- data/framework_components/monitoring-interface/data/data.json +2118 -0
- data/framework_components/monitoring-interface/data/data2.json +814 -0
- data/framework_components/monitoring-interface/data/data3.json +823 -0
- data/framework_components/monitoring-interface/data/data4.json +848 -0
- data/framework_components/monitoring-interface/data/message.json +999 -0
- data/framework_components/monitoring-interface/gulpfile.js +29 -0
- data/framework_components/monitoring-interface/img/arrow_white.svg +120 -0
- data/framework_components/monitoring-interface/img/arrow_white_right.svg +104 -0
- data/framework_components/monitoring-interface/img/back.svg +164 -0
- data/framework_components/monitoring-interface/img/cross_red_border_white.svg +143 -0
- data/framework_components/monitoring-interface/img/cross_red_border_white_mouseover.svg +143 -0
- data/framework_components/monitoring-interface/img/email.svg +89 -0
- data/framework_components/monitoring-interface/img/email_highlighted.svg +89 -0
- data/framework_components/monitoring-interface/index.html +144 -0
- data/framework_components/monitoring-interface/js/d3/layout/grid-layout.js +103 -0
- data/framework_components/monitoring-interface/js/d3/layout/radial-layout.js +184 -0
- data/framework_components/monitoring-interface/js/d3/plugin/graphics.js +156 -0
- data/framework_components/monitoring-interface/js/d3/plugin/tab-table.js +8 -0
- data/framework_components/monitoring-interface/js/d3/ui/animations.js +27 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-application.js +471 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-connection-view.js +847 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-element.js +245 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-legend.js +174 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-notification.js +90 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-tab.js +309 -0
- data/framework_components/monitoring-interface/js/lib/JSXTransformer-0.12.2.js +15199 -0
- data/framework_components/monitoring-interface/js/lib/bootstrap.min.js +7 -0
- data/framework_components/monitoring-interface/js/lib/d3.v3.min.js +5 -0
- data/framework_components/monitoring-interface/js/lib/highlight.min.js +2 -0
- data/framework_components/monitoring-interface/js/lib/jquery-1.10.0.min.js +6 -0
- data/framework_components/monitoring-interface/js/lib/nutella_lib.js +5121 -0
- data/framework_components/monitoring-interface/js/lib/react-with-addons-0.12.2.js +19822 -0
- data/framework_components/monitoring-interface/js/lib/underscore-min.js +5 -0
- data/framework_components/monitoring-interface/js/model/alerts-model.js +74 -0
- data/framework_components/monitoring-interface/js/model/applications-model.js +78 -0
- data/framework_components/monitoring-interface/js/model/messages-model.js +112 -0
- data/framework_components/monitoring-interface/js/notification/notification-center.js +63 -0
- data/framework_components/monitoring-interface/js/notification/notifications.js +21 -0
- data/framework_components/monitoring-interface/js/react/dist/ui-alerts.js +178 -0
- data/framework_components/monitoring-interface/js/react/dist/ui-message-send.js +389 -0
- data/framework_components/monitoring-interface/js/react/dist/ui-messages.js +103 -0
- data/framework_components/monitoring-interface/js/react/src/ui-alerts.js +178 -0
- data/framework_components/monitoring-interface/js/react/src/ui-message-send.js +389 -0
- data/framework_components/monitoring-interface/js/react/src/ui-messages.js +103 -0
- data/framework_components/monitoring-interface/js/view-controller/application-view-controller.js +256 -0
- data/framework_components/monitoring-interface/js/view-controller/instance-view-controller.js +112 -0
- data/framework_components/monitoring-interface/js/view-controller/view-controller.js +74 -0
- data/framework_components/monitoring-interface/js/view-controller/window-view-controller.js +169 -0
- data/framework_components/monitoring-interface/nutella.json +6 -0
- data/framework_components/order.json +1 -0
- data/framework_components/roomcast-bot/roomcast_bot.rb +139 -117
- data/framework_components/roomcast-channel-creator/dist/app.js +9 -7
- data/framework_components/roomcast-channel-creator/index.html +1 -1
- data/framework_components/roomcast-channel-creator/src/app/components/main.js +8 -6
- data/framework_components/roomcast-package-creator/dist/app.js +4 -4
- data/framework_components/roomcast-package-creator/index.html +1 -1
- data/framework_components/roomcast-package-creator/package.json +3 -3
- data/framework_components/roomcast-package-creator/src/app/components/ConfigurationsPanel.js +2 -2
- data/framework_components/roomcast-package-creator/src/app/components/PoolRow.js +1 -1
- data/framework_components/roomcast-teacher-controls/.gitignore +2 -0
- data/framework_components/roomcast-teacher-controls/README.md +9 -0
- data/framework_components/roomcast-teacher-controls/dist/app.js +38327 -0
- data/framework_components/roomcast-teacher-controls/dist/main.css +3052 -0
- data/framework_components/roomcast-teacher-controls/dist/nutella_lib.js +5121 -0
- data/framework_components/roomcast-teacher-controls/gulp/config.js +51 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/browserify.js +77 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/build.js +3 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/css.js +7 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/default.js +3 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/fonts.js +7 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/less.js +16 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/mui-fonts.js +7 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/nutella.js +7 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/setWatch.js +5 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/svgs.js +7 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/watch.js +12 -0
- data/framework_components/roomcast-teacher-controls/gulp/util/bundleLogger.js +21 -0
- data/framework_components/roomcast-teacher-controls/gulp/util/handleErrors.js +15 -0
- data/framework_components/roomcast-teacher-controls/gulpfile.js +16 -0
- data/framework_components/roomcast-teacher-controls/index.html +51 -0
- data/framework_components/roomcast-teacher-controls/nutella.json +6 -0
- data/framework_components/roomcast-teacher-controls/package.json +38 -0
- data/framework_components/roomcast-teacher-controls/src/app/app.js +22 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/ActivitiesGrid.js +87 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/ActivityCard.js +141 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/Channel.js +70 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/Footer.js +34 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/main.js +74 -0
- data/framework_components/roomcast-teacher-controls/src/less/main.less +186 -0
- data/framework_components/roomcast-teacher-controls/src/less/my_overrides.less +14 -0
- data/lib/commands/meta/run_command.rb +11 -9
- metadata +135 -2
@@ -0,0 +1,51 @@
|
|
1
|
+
var dest = './dist',
|
2
|
+
src = './src',
|
3
|
+
mui = './node_modules/material-ui/src';
|
4
|
+
|
5
|
+
module.exports = {
|
6
|
+
browserSync: {
|
7
|
+
server: {
|
8
|
+
// We're serving the src folder as well
|
9
|
+
// for sass sourcemap linking
|
10
|
+
baseDir: [dest, src]
|
11
|
+
},
|
12
|
+
files: [
|
13
|
+
dest + '/**'
|
14
|
+
]
|
15
|
+
},
|
16
|
+
less: {
|
17
|
+
src: src + '/less/main.less',
|
18
|
+
watch: [
|
19
|
+
src + '/less/**',
|
20
|
+
mui + '/less/**'
|
21
|
+
],
|
22
|
+
dest: dest
|
23
|
+
},
|
24
|
+
css: {
|
25
|
+
src: src + "/css/**",
|
26
|
+
dest: dest + "/css"
|
27
|
+
},
|
28
|
+
fonts: {
|
29
|
+
src: src + '/fonts/**',
|
30
|
+
dest: dest + '/fonts'
|
31
|
+
},
|
32
|
+
muiFonts: {
|
33
|
+
src: mui + '/less/material-ui-icons/fonts/**',
|
34
|
+
dest: dest + '/fonts'
|
35
|
+
},
|
36
|
+
nutella: {
|
37
|
+
src: './node_modules/nutella_lib/dist/nutella_lib.js',
|
38
|
+
dest: dest
|
39
|
+
},
|
40
|
+
browserify: {
|
41
|
+
// Enable source maps
|
42
|
+
debug: true,
|
43
|
+
// A separate bundle will be generated for each
|
44
|
+
// bundle config in the list below
|
45
|
+
bundleConfigs: [{
|
46
|
+
entries: src + '/app/app.js',
|
47
|
+
dest: dest,
|
48
|
+
outputName: 'app.js'
|
49
|
+
}]
|
50
|
+
}
|
51
|
+
};
|
@@ -0,0 +1,77 @@
|
|
1
|
+
/* browserify task
|
2
|
+
---------------
|
3
|
+
Bundle javascripty things with browserify!
|
4
|
+
This task is set up to generate multiple separate bundles, from
|
5
|
+
different sources, and to use Watchify when run from the default task.
|
6
|
+
See browserify.bundleConfigs in gulp/config.js
|
7
|
+
*/
|
8
|
+
|
9
|
+
var browserify = require('browserify');
|
10
|
+
var watchify = require('watchify');
|
11
|
+
var bundleLogger = require('../util/bundleLogger');
|
12
|
+
var gulp = require('gulp');
|
13
|
+
var handleErrors = require('../util/handleErrors');
|
14
|
+
var source = require('vinyl-source-stream');
|
15
|
+
var config = require('../config').browserify;
|
16
|
+
|
17
|
+
gulp.task('browserify', function(callback) {
|
18
|
+
|
19
|
+
var bundleQueue = config.bundleConfigs.length;
|
20
|
+
|
21
|
+
var browserifyThis = function(bundleConfig) {
|
22
|
+
|
23
|
+
var bundler = browserify({
|
24
|
+
// Required watchify args
|
25
|
+
cache: {}, packageCache: {}, fullPaths: false,
|
26
|
+
// Specify the entry point of your app
|
27
|
+
entries: bundleConfig.entries,
|
28
|
+
// Add file extentions to make optional in your requires
|
29
|
+
extensions: config.extensions,
|
30
|
+
// Enable source maps!
|
31
|
+
debug: config.debug
|
32
|
+
});
|
33
|
+
|
34
|
+
var bundle = function() {
|
35
|
+
// Log when bundling starts
|
36
|
+
bundleLogger.start(bundleConfig.outputName);
|
37
|
+
|
38
|
+
return bundler
|
39
|
+
.bundle()
|
40
|
+
// Report compile errors
|
41
|
+
.on('error', handleErrors)
|
42
|
+
// Use vinyl-source-stream to make the
|
43
|
+
// stream gulp compatible. Specifiy the
|
44
|
+
// desired output filename here.
|
45
|
+
.pipe(source(bundleConfig.outputName))
|
46
|
+
// Specify the output destination
|
47
|
+
.pipe(gulp.dest(bundleConfig.dest))
|
48
|
+
.on('end', reportFinished);
|
49
|
+
};
|
50
|
+
|
51
|
+
if(global.isWatching) {
|
52
|
+
// Wrap with watchify and rebundle on changes
|
53
|
+
bundler = watchify(bundler);
|
54
|
+
// Rebundle on update
|
55
|
+
bundler.on('update', bundle);
|
56
|
+
}
|
57
|
+
|
58
|
+
var reportFinished = function() {
|
59
|
+
// Log when bundling completes
|
60
|
+
bundleLogger.end(bundleConfig.outputName);
|
61
|
+
|
62
|
+
if(bundleQueue) {
|
63
|
+
bundleQueue--;
|
64
|
+
if(bundleQueue === 0) {
|
65
|
+
// If queue is empty, tell gulp the task is complete.
|
66
|
+
// https://github.com/gulpjs/gulp/blob/master/docs/API.md#accept-a-callback
|
67
|
+
callback();
|
68
|
+
}
|
69
|
+
}
|
70
|
+
};
|
71
|
+
|
72
|
+
return bundle();
|
73
|
+
};
|
74
|
+
|
75
|
+
// Start bundling with Browserify for each bundleConfig specified
|
76
|
+
config.bundleConfigs.forEach(browserifyThis);
|
77
|
+
});
|
@@ -0,0 +1,16 @@
|
|
1
|
+
var gulp = require('gulp'),
|
2
|
+
less = require('gulp-less'),
|
3
|
+
autoprefixer = require('gulp-autoprefixer'),
|
4
|
+
sourcemaps = require('gulp-sourcemaps'),
|
5
|
+
handleErrors = require('../util/handleErrors'),
|
6
|
+
config = require('../config').less;
|
7
|
+
|
8
|
+
gulp.task('less', function() {
|
9
|
+
return gulp.src(config.src)
|
10
|
+
.pipe(sourcemaps.init())
|
11
|
+
.pipe(less())
|
12
|
+
.on('error', handleErrors)
|
13
|
+
.pipe(autoprefixer({cascade: false, browsers: ['last 2 versions']}))
|
14
|
+
.pipe(sourcemaps.write())
|
15
|
+
.pipe(gulp.dest(config.dest));
|
16
|
+
});
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
/* Notes:
|
3
|
+
- gulp/tasks/browserify.js handles js recompiling with watchify
|
4
|
+
- gulp/tasks/browserSync.js watches and reloads compiled files
|
5
|
+
*/
|
6
|
+
|
7
|
+
var gulp = require('gulp');
|
8
|
+
var config = require('../config');
|
9
|
+
|
10
|
+
gulp.task('watch', ['setWatch'], function() {
|
11
|
+
gulp.watch(config.less.watch, ['less']);
|
12
|
+
});
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/* bundleLogger
|
2
|
+
------------
|
3
|
+
Provides gulp style logs to the bundle method in browserify.js
|
4
|
+
*/
|
5
|
+
|
6
|
+
var gutil = require('gulp-util');
|
7
|
+
var prettyHrtime = require('pretty-hrtime');
|
8
|
+
var startTime;
|
9
|
+
|
10
|
+
module.exports = {
|
11
|
+
start: function(filepath) {
|
12
|
+
startTime = process.hrtime();
|
13
|
+
gutil.log('Bundling', gutil.colors.green(filepath) + '...');
|
14
|
+
},
|
15
|
+
|
16
|
+
end: function(filepath) {
|
17
|
+
var taskTime = process.hrtime(startTime);
|
18
|
+
var prettyTime = prettyHrtime(taskTime);
|
19
|
+
gutil.log('Bundled', gutil.colors.green(filepath), 'in', gutil.colors.magenta(prettyTime));
|
20
|
+
}
|
21
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
var notify = require("gulp-notify");
|
2
|
+
|
3
|
+
module.exports = function() {
|
4
|
+
|
5
|
+
var args = Array.prototype.slice.call(arguments);
|
6
|
+
|
7
|
+
// Send error to notification center with gulp-notify
|
8
|
+
notify.onError({
|
9
|
+
title: "Compile Error",
|
10
|
+
message: "<%= error.message %>"
|
11
|
+
}).apply(this, args);
|
12
|
+
|
13
|
+
// Keep gulp from hanging on this task
|
14
|
+
this.emit('end');
|
15
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/*
|
2
|
+
gulpfile.js
|
3
|
+
===========
|
4
|
+
Rather than manage one giant configuration file responsible
|
5
|
+
for creating multiple tasks, each task has been broken out into
|
6
|
+
its own file in gulp/tasks. Any files in that directory get
|
7
|
+
automatically required below.
|
8
|
+
To add a new task, simply add a new task file that directory.
|
9
|
+
gulp/tasks/default.js specifies the default set of tasks to run
|
10
|
+
when you run `gulp`.
|
11
|
+
*/
|
12
|
+
|
13
|
+
var requireDir = require('require-dir');
|
14
|
+
|
15
|
+
// Require all tasks in gulp/tasks, including subfolders
|
16
|
+
requireDir('./gulp/tasks', { recurse: true });
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html class="no-js" lang="">
|
3
|
+
|
4
|
+
<head>
|
5
|
+
<meta charset="utf-8">
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
7
|
+
<title>RoomCast - Teacher controls</title>
|
8
|
+
<meta name="description" content="The interface to control the class activities in real-time.">
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
10
|
+
<link rel="stylesheet" type="text/css" href="dist/main.css">
|
11
|
+
</head>
|
12
|
+
|
13
|
+
<body>
|
14
|
+
|
15
|
+
<!-- Nutella -->
|
16
|
+
<script src="dist/nutella_lib.js" type="text/javascript" charset="utf-8"></script>
|
17
|
+
<script type="text/javascript">
|
18
|
+
|
19
|
+
// Parse the query parameters
|
20
|
+
var query_parameters = NUTELLA.parseURLParameters();
|
21
|
+
|
22
|
+
// Get an instance of nutella.
|
23
|
+
var nutella = NUTELLA.init(query_parameters.broker, query_parameters.app_id, query_parameters.run_id, 'broadcasting-interface');
|
24
|
+
|
25
|
+
</script>
|
26
|
+
|
27
|
+
<!-- This script adds the Roboto font to our project. For more detail go to this site: http://www.google.com/fonts#UsePlace:use/Collection:Roboto:400,300,500 -->
|
28
|
+
<script>
|
29
|
+
var WebFontConfig = {
|
30
|
+
google: {
|
31
|
+
families: ['Roboto:400,300,200,100,500:latin']
|
32
|
+
}
|
33
|
+
};
|
34
|
+
(function () {
|
35
|
+
var wf = document.createElement('script');
|
36
|
+
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
|
37
|
+
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
|
38
|
+
wf.type = 'text/javascript';
|
39
|
+
wf.async = 'true';
|
40
|
+
var s = document.getElementsByTagName('script')[0];
|
41
|
+
s.parentNode.insertBefore(wf, s);
|
42
|
+
})();
|
43
|
+
</script>
|
44
|
+
|
45
|
+
<script src="dist/app.js"></script>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
</body>
|
50
|
+
|
51
|
+
</html>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
{
|
2
|
+
"name": "roomcast-teacher-controls",
|
3
|
+
"version": "0.1.0",
|
4
|
+
"description": "",
|
5
|
+
"browserify": {
|
6
|
+
"transform": [
|
7
|
+
[
|
8
|
+
"reactify",
|
9
|
+
{
|
10
|
+
"es6": true
|
11
|
+
}
|
12
|
+
]
|
13
|
+
]
|
14
|
+
},
|
15
|
+
"devDependencies": {
|
16
|
+
"browser-sync": "^1.8.1",
|
17
|
+
"browserify": "^7.0.3",
|
18
|
+
"gulp": "^3.8.10",
|
19
|
+
"gulp-autoprefixer": "^2.0.0",
|
20
|
+
"gulp-less": "^3.0.0",
|
21
|
+
"gulp-notify": "^2.1.0",
|
22
|
+
"gulp-sourcemaps": "^1.2.8",
|
23
|
+
"gulp-util": "^3.0.1",
|
24
|
+
"pretty-hrtime": "^0.2.2",
|
25
|
+
"reactify": "^0.17.1",
|
26
|
+
"require-dir": "^0.1.0",
|
27
|
+
"underscore": "^1.7.0",
|
28
|
+
"vinyl-source-stream": "^1.0.0",
|
29
|
+
"watchify": "^2.2.1"
|
30
|
+
},
|
31
|
+
"dependencies": {
|
32
|
+
"d3": "^3.5.5",
|
33
|
+
"material-ui": "^0.7.0",
|
34
|
+
"nutella_lib": "^0.5.1",
|
35
|
+
"react": "^0.13.0",
|
36
|
+
"react-tap-event-plugin": "^0.1.3"
|
37
|
+
}
|
38
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
(function () {
|
3
|
+
|
4
|
+
var React = require('react'),
|
5
|
+
injectTapEventPlugin = require("react-tap-event-plugin"),
|
6
|
+
Main = require('./components/main.js'); // Our custom react component
|
7
|
+
|
8
|
+
//Needed for React Developer Tools
|
9
|
+
window.React = React;
|
10
|
+
|
11
|
+
//Needed for onTouchTap
|
12
|
+
//Can go away when react 1.0 release
|
13
|
+
//Check this repo:
|
14
|
+
//https://github.com/zilverline/react-tap-event-plugin
|
15
|
+
injectTapEventPlugin();
|
16
|
+
|
17
|
+
// Render the main app react component into the document body.
|
18
|
+
// For more details see: https://facebook.github.io/react/docs/top-level-api.html#react.render
|
19
|
+
//window.ReactMain = 'Main component';
|
20
|
+
window.ReactMain = React.render(<Main />, document.body);
|
21
|
+
|
22
|
+
})();
|
@@ -0,0 +1,87 @@
|
|
1
|
+
|
2
|
+
var React = require('react');
|
3
|
+
var Mui = require('material-ui');
|
4
|
+
var ActivityCard = require('./ActivityCard');
|
5
|
+
|
6
|
+
var ActivitiesGrid = React.createClass({
|
7
|
+
|
8
|
+
componentWillMount: function() {
|
9
|
+
this._externalMargin = 20;
|
10
|
+
this._cardMargin = 20;
|
11
|
+
this._heightRatio = 0.9;
|
12
|
+
|
13
|
+
this.computeGrid(this.props.configs);
|
14
|
+
},
|
15
|
+
|
16
|
+
componentWillReceiveProps: function(nextProps) {
|
17
|
+
this.computeGrid(nextProps.configs);
|
18
|
+
},
|
19
|
+
|
20
|
+
/**
|
21
|
+
* Computes grid size based on given number of configs.
|
22
|
+
*/
|
23
|
+
computeGrid: function(configs) {
|
24
|
+
var N = Object.keys(configs).length; // num of total cards
|
25
|
+
var i = 1; // num of rows
|
26
|
+
var j = 2; // num of columns
|
27
|
+
for(var n=1; n<=N; n++) {
|
28
|
+
var p = i * j;
|
29
|
+
if(n > p) {
|
30
|
+
if(i < j) {
|
31
|
+
i++;
|
32
|
+
} else {
|
33
|
+
j++;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
var cardWidth = (window.innerWidth - this._externalMargin*2 - this._cardMargin*2*j) / j;
|
38
|
+
var cardHeight = (window.innerHeight*this._heightRatio - this._externalMargin - this._cardMargin*2*i) / i;
|
39
|
+
this._cardSize = [cardWidth, cardHeight];
|
40
|
+
|
41
|
+
},
|
42
|
+
|
43
|
+
render: function () {
|
44
|
+
|
45
|
+
var cards = [];
|
46
|
+
|
47
|
+
var height = window.innerHeight * this._heightRatio;
|
48
|
+
var gridStyle = {height: height};
|
49
|
+
|
50
|
+
var cardStyle = {
|
51
|
+
width: this._cardSize[0],
|
52
|
+
height: this._cardSize[1],
|
53
|
+
//position: 'absolute',
|
54
|
+
flexBasis: this._cardSize[0]
|
55
|
+
};
|
56
|
+
|
57
|
+
for(var c in this.props.configs) {
|
58
|
+
if(this.props.configs.hasOwnProperty(c)) {
|
59
|
+
cards.push(
|
60
|
+
<ActivityCard
|
61
|
+
configId={c}
|
62
|
+
configName={this.props.configs[c].name}
|
63
|
+
currentConfigId={this.props.currentConfig}
|
64
|
+
cardStyle={cardStyle}
|
65
|
+
/>
|
66
|
+
);
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
// Flip order
|
71
|
+
var cards_ = [];
|
72
|
+
for(var i=cards.length-1; i>=0; i--) {
|
73
|
+
cards_.push(cards[i]);
|
74
|
+
}
|
75
|
+
|
76
|
+
return (
|
77
|
+
|
78
|
+
<div className='activities-grid' style={gridStyle} >
|
79
|
+
{cards_}
|
80
|
+
</div>
|
81
|
+
|
82
|
+
);
|
83
|
+
}
|
84
|
+
|
85
|
+
});
|
86
|
+
|
87
|
+
module.exports = ActivitiesGrid;
|
@@ -0,0 +1,141 @@
|
|
1
|
+
|
2
|
+
var React = require('react');
|
3
|
+
var Mui = require('material-ui');
|
4
|
+
var Paper = Mui.Paper;
|
5
|
+
var d3 = require('d3');
|
6
|
+
|
7
|
+
var ActivityCard = React.createClass({
|
8
|
+
|
9
|
+
componentDidMount: function() {
|
10
|
+
var self= this;
|
11
|
+
this._colorSelected = '#00bcd4';
|
12
|
+
this._timerDuration = 1500;
|
13
|
+
|
14
|
+
d3.select(this.getDOMNode())
|
15
|
+
.on('touchstart', function() {
|
16
|
+
self.cardTouchIn.call(self, this);
|
17
|
+
})
|
18
|
+
.on('mousedown', function() {
|
19
|
+
self.cardTouchIn.call(self, this);
|
20
|
+
})
|
21
|
+
.on('touchend', function() {
|
22
|
+
self.cardTouchOut.call(self);
|
23
|
+
})
|
24
|
+
.on('mouseup', function() {
|
25
|
+
self.cardTouchOut.call(self);
|
26
|
+
});
|
27
|
+
|
28
|
+
},
|
29
|
+
|
30
|
+
cardTouchIn: function(el) {
|
31
|
+
var self = this;
|
32
|
+
|
33
|
+
var cardWidth = this.props.cardStyle['width'];
|
34
|
+
var cardHeight = this.props.cardStyle['height'];
|
35
|
+
var circleRadius = Math.sqrt(Math.pow(cardWidth, 2) + Math.pow(cardHeight, 2)) / 2;
|
36
|
+
|
37
|
+
var publishAfterTransition = function() {
|
38
|
+
var action = function() {
|
39
|
+
nutella.net.publish('currentConfig/update', +self.props.configId);
|
40
|
+
};
|
41
|
+
self._timeoutId = setTimeout(action, self._timerDuration);
|
42
|
+
};
|
43
|
+
|
44
|
+
var svg = d3.select(el)
|
45
|
+
.select('.card-svg')
|
46
|
+
.append('svg')
|
47
|
+
.style({
|
48
|
+
width: cardWidth,
|
49
|
+
height: cardHeight
|
50
|
+
});
|
51
|
+
|
52
|
+
svg.append('circle')
|
53
|
+
.attr({
|
54
|
+
cx: cardWidth / 2,
|
55
|
+
cy: cardHeight / 2,
|
56
|
+
r: '0px'
|
57
|
+
})
|
58
|
+
.style({
|
59
|
+
fill: this._colorSelected
|
60
|
+
})
|
61
|
+
.transition()
|
62
|
+
.call(publishAfterTransition)
|
63
|
+
.duration(self._timerDuration)
|
64
|
+
.attr({
|
65
|
+
r: circleRadius
|
66
|
+
});
|
67
|
+
|
68
|
+
},
|
69
|
+
|
70
|
+
cardTouchOut: function() {
|
71
|
+
d3.selectAll('.activity-card')
|
72
|
+
.select('.card-svg')
|
73
|
+
.select('svg')
|
74
|
+
.remove();
|
75
|
+
|
76
|
+
window.clearTimeout(this._timeoutId);
|
77
|
+
},
|
78
|
+
|
79
|
+
componentWillReceiveProps: function(newProps) {
|
80
|
+
if(+newProps.currentConfigId === +newProps.configId) {
|
81
|
+
this.setState({
|
82
|
+
isSelected: true
|
83
|
+
});
|
84
|
+
} else {
|
85
|
+
this.setState({
|
86
|
+
isSelected: false
|
87
|
+
});
|
88
|
+
}
|
89
|
+
|
90
|
+
},
|
91
|
+
|
92
|
+
getInitialState: function () {
|
93
|
+
return {
|
94
|
+
isSelected: false
|
95
|
+
}
|
96
|
+
},
|
97
|
+
|
98
|
+
render: function () {
|
99
|
+
|
100
|
+
var selectedCardStyle = {
|
101
|
+
backgroundColor: this._colorSelected,
|
102
|
+
color: 'white'
|
103
|
+
};
|
104
|
+
|
105
|
+
// Copy
|
106
|
+
var cardStyle = {};
|
107
|
+
for(var p_ in this.props.cardStyle) {
|
108
|
+
cardStyle[p_] = this.props.cardStyle[p_];
|
109
|
+
}
|
110
|
+
|
111
|
+
var className='activity-card';
|
112
|
+
|
113
|
+
// Add properties if selected
|
114
|
+
if(this.state.isSelected) {
|
115
|
+
className += ' activity-card-selected';
|
116
|
+
for(var p in selectedCardStyle) {
|
117
|
+
cardStyle[p] = selectedCardStyle[p];
|
118
|
+
}
|
119
|
+
|
120
|
+
}
|
121
|
+
|
122
|
+
return (
|
123
|
+
|
124
|
+
<Paper className={className} style={cardStyle} >
|
125
|
+
|
126
|
+
<div className='card-svg'> </div>
|
127
|
+
|
128
|
+
<div className='card-name'>
|
129
|
+
|
130
|
+
<span> {this.props.configName} </span>
|
131
|
+
|
132
|
+
</div>
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
</Paper>);
|
137
|
+
}
|
138
|
+
|
139
|
+
});
|
140
|
+
|
141
|
+
module.exports = ActivityCard;
|