nutella_framework 0.6.18 → 0.6.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/framework_components/roomcast-bot/roomcast_bot.rb +34 -23
- data/framework_components/roomcast-bot/startup +3 -2
- data/framework_components/roomcast-main-app/dist/app.js +51 -14
- data/framework_components/roomcast-main-app/src/app/components/NutellaMixin.js +3 -1
- data/framework_components/roomcast-main-app/src/app/components/app/main.js +17 -6
- data/framework_components/roomcast-main-app/src/app/components/identity-selector/IdentitiesGrid.js +5 -1
- data/framework_components/roomcast-main-app/src/app/components/identity-selector/IdentityCard.js +19 -2
- data/framework_components/roomcast-main-app/src/app/components/identity-selector/main.js +5 -1
- data/framework_components/roomcast-main-app/src/app/components/login/main.js +0 -1
- data/framework_components/roomcast-package-creator/dist/app.js +78 -31
- data/framework_components/roomcast-package-creator/dist/main.css +15 -3
- data/framework_components/roomcast-package-creator/src/app/app.js +1 -0
- data/framework_components/roomcast-package-creator/src/app/components/ChannelsCatalogue.js +3 -11
- data/framework_components/roomcast-package-creator/src/app/components/NutellaMixin.js +50 -15
- data/framework_components/roomcast-package-creator/src/app/components/main.js +21 -2
- data/framework_components/roomcast-package-creator/src/less/main.less +9 -2
- data/framework_components/roomcast-teacher-controls/dist/app.js +77 -5
- data/framework_components/roomcast-teacher-controls/index.html +1 -3
- data/framework_components/roomcast-teacher-controls/src/app/components/ActivityCard.js +8 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/Footer.js +5 -1
- data/framework_components/roomcast-teacher-controls/src/app/components/NutellaMixin.js +57 -0
- metadata +3 -3
- data/framework_components/roomcast-teacher-controls/src/app/components/Channel.js +0 -70
@@ -21,6 +21,7 @@
|
|
21
21
|
}
|
22
22
|
});
|
23
23
|
} else {
|
24
|
+
// for debugging purposes - works with tests outside of nutella
|
24
25
|
window.nutella = NUTELLA.init('ltg.evl.uic.edu', 'wallcology', 'default', 'roomcast-package-creator', function(connected) {
|
25
26
|
window.ReactMain = React.render( <Main /> , document.body);
|
26
27
|
});
|
@@ -8,22 +8,14 @@ var ChannelsCatalogue = React.createClass({
|
|
8
8
|
this.props.onSelectedChannel(ch);
|
9
9
|
},
|
10
10
|
|
11
|
-
handleStyleRespectiveChannel: function() {
|
12
|
-
var selected = this.props.selectedChannel;
|
13
|
-
for(ref in this.refs) {
|
14
|
-
console.log(ref, selected);
|
15
|
-
if(this.refs[ref].props.id===selected.id) {
|
16
|
-
console.log(selected.imgNode);
|
17
|
-
break;
|
18
|
-
}
|
19
|
-
}
|
20
|
-
},
|
21
|
-
|
22
11
|
render: function() {
|
23
12
|
|
24
13
|
var channels = [];
|
25
14
|
var chs = this.props.channels;
|
26
15
|
var keys = Object.keys(chs).sort();
|
16
|
+
keys = keys.sort(function(a, b) {
|
17
|
+
return (+a) - (+b);
|
18
|
+
});
|
27
19
|
for(var i = 0; i < keys.length; i++) {
|
28
20
|
var key = keys[i];
|
29
21
|
|
@@ -1,21 +1,56 @@
|
|
1
|
+
var NUTELLA = require('nutella_lib');
|
1
2
|
|
2
3
|
var NutellaMixin = {
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
5
|
+
/**
|
6
|
+
* Stores a user interaction as a document in the MongoDB database.
|
7
|
+
* @param action name of the action fired
|
8
|
+
* @param info additional properties to be stored for the specific interaction
|
9
|
+
*/
|
10
|
+
logAction: function(action, info) {
|
11
|
+
var query_parameters = NUTELLA.parseURLParameters();
|
12
|
+
var app_id = query_parameters.app_id;
|
13
|
+
var run_id = query_parameters.run_id;
|
14
|
+
var cookie = this.getCookie('roomcast_device');
|
15
|
+
if(cookie === '') {
|
16
|
+
cookie = (+new Date * Math.random()).toString(36).substring(0, 15);
|
17
|
+
this.setCookie('roomcast_device', cookie, 365);
|
18
|
+
}
|
19
|
+
var date = new Date();
|
20
|
+
var doc = {};
|
21
|
+
doc.action = action;
|
22
|
+
doc.app_id = app_id;
|
23
|
+
doc.run_id = run_id;
|
24
|
+
doc.device_id = cookie;
|
25
|
+
doc.time = {
|
26
|
+
timestamp: date,
|
27
|
+
year: date.getFullYear(),
|
28
|
+
month: date.getMonth() + 1,
|
29
|
+
day: date.getDate(),
|
30
|
+
time: date.getHours() + ":" +date.getMinutes() + ":" +date.getSeconds()
|
31
|
+
};
|
32
|
+
if(Object.keys(info).length !== 0) {
|
33
|
+
doc.info = info;
|
34
|
+
}
|
35
|
+
nutella.net.publish('roomcast-log-bot/store', doc);
|
36
|
+
},
|
37
|
+
|
38
|
+
setCookie: function(cname, cvalue, exdays) {
|
39
|
+
var d = new Date();
|
40
|
+
d.setTime(d.getTime() + (exdays*24*60*60*1000));
|
41
|
+
var expires = "expires="+d.toUTCString();
|
42
|
+
document.cookie = cname + "=" + cvalue + "; " + expires;
|
43
|
+
},
|
44
|
+
|
45
|
+
getCookie: function(cname) {
|
46
|
+
var name = cname + "=";
|
47
|
+
var ca = document.cookie.split(';');
|
48
|
+
for(var i=0; i<ca.length; i++) {
|
49
|
+
var c = ca[i];
|
50
|
+
while (c.charAt(0)==' ') c = c.substring(1);
|
51
|
+
if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
|
52
|
+
}
|
53
|
+
return "";
|
19
54
|
}
|
20
55
|
|
21
56
|
};
|
@@ -1,14 +1,18 @@
|
|
1
1
|
var React = require('react'),
|
2
2
|
mui = require('material-ui'),
|
3
|
-
RaisedButton = mui.RaisedButton
|
3
|
+
RaisedButton = mui.RaisedButton,
|
4
|
+
NutellaMixin = require('./NutellaMixin');
|
4
5
|
|
5
6
|
var ResourcesPanel = require('./ResourcesPanel.js');
|
6
7
|
var ChannelsPanel = require('./ChannelsPanel');
|
7
8
|
|
8
9
|
var Main = React.createClass({
|
9
10
|
|
11
|
+
mixins: [NutellaMixin],
|
12
|
+
|
10
13
|
componentDidMount: function() {
|
11
14
|
var self = this;
|
15
|
+
self._cookie = (+new Date * Math.random()).toString(36).substring(0, 15);
|
12
16
|
// Get current channels catalogue
|
13
17
|
nutella.net.request('channels/retrieve', 'all', function (response) {
|
14
18
|
self.handleUpdatedChannelsCatalogue(response);
|
@@ -18,7 +22,13 @@ var Main = React.createClass({
|
|
18
22
|
self.handleUpdatedChannelsCatalogue(message);
|
19
23
|
});
|
20
24
|
nutella.net.subscribe('configs/updated', function (message, from) {
|
21
|
-
|
25
|
+
// workaround to manage sync between multiple parallell changes: reload page
|
26
|
+
// on all the interfaces other than the one which has saved the changes
|
27
|
+
if(self.getCookie('roomcast-id') !== self._cookie) {
|
28
|
+
window.location.reload(true);
|
29
|
+
}
|
30
|
+
// reset local cookie
|
31
|
+
self._cookie = (+new Date * Math.random()).toString(36).substring(0, 15);
|
22
32
|
});
|
23
33
|
});
|
24
34
|
},
|
@@ -91,6 +101,15 @@ var Main = React.createClass({
|
|
91
101
|
handleSaveChanges: function() {
|
92
102
|
var publish = true;
|
93
103
|
this.saveLocalConfigs(publish);
|
104
|
+
// identify current device when message comes back
|
105
|
+
this._cookie = (+new Date * Math.random()).toString(36).substring(0, 15);
|
106
|
+
this.setCookie('roomcast-id', this._cookie, 365);
|
107
|
+
|
108
|
+
// #LOG action
|
109
|
+
this.logAction('savePackageCreator', {
|
110
|
+
configuration: this.state.configs,
|
111
|
+
channels_catalogue: this.state.channelsCatalogue
|
112
|
+
});
|
94
113
|
},
|
95
114
|
|
96
115
|
handleUndoChanges: function() {
|
@@ -235,9 +235,16 @@ html, body {
|
|
235
235
|
//line-height: 10px;
|
236
236
|
}
|
237
237
|
.mui-raised-button {
|
238
|
-
//height: 50%;
|
239
238
|
.mui-raised-button-label {
|
240
|
-
|
239
|
+
@media (min-width: 1784px) {
|
240
|
+
font-size: 14px;
|
241
|
+
}
|
242
|
+
@media (min-width: 1643px) and (max-width: 1783px) {
|
243
|
+
font-size: 12px;
|
244
|
+
}
|
245
|
+
@media (max-width: 1642px) {
|
246
|
+
font-size: 10px;
|
247
|
+
}
|
241
248
|
}
|
242
249
|
.mui-raised-button-container {
|
243
250
|
//height: 50%;
|