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
@@ -20,7 +20,7 @@
|
|
20
20
|
var query_parameters = NUTELLA.parseURLParameters();
|
21
21
|
|
22
22
|
// Get an instance of nutella.
|
23
|
-
var nutella = NUTELLA.init(query_parameters.broker, query_parameters.app_id, query_parameters.run_id, '
|
23
|
+
var nutella = NUTELLA.init(query_parameters.broker, query_parameters.app_id, query_parameters.run_id, 'roomcast-teacher-interface');
|
24
24
|
|
25
25
|
</script>
|
26
26
|
|
@@ -44,8 +44,6 @@
|
|
44
44
|
|
45
45
|
<script src="dist/app.js"></script>
|
46
46
|
|
47
|
-
|
48
|
-
|
49
47
|
</body>
|
50
48
|
|
51
49
|
</html>
|
@@ -3,9 +3,12 @@ var React = require('react');
|
|
3
3
|
var Mui = require('material-ui');
|
4
4
|
var Paper = Mui.Paper;
|
5
5
|
var d3 = require('d3');
|
6
|
+
var NutellaMixin = require('./NutellaMixin');
|
6
7
|
|
7
8
|
var ActivityCard = React.createClass({
|
8
9
|
|
10
|
+
mixins: [NutellaMixin],
|
11
|
+
|
9
12
|
componentDidMount: function() {
|
10
13
|
var self= this;
|
11
14
|
this._colorSelected = '#00bcd4';
|
@@ -36,6 +39,11 @@ var ActivityCard = React.createClass({
|
|
36
39
|
|
37
40
|
var publishAfterTransition = function() {
|
38
41
|
var action = function() {
|
42
|
+
// #LOG action
|
43
|
+
self.logAction('launchActivity', {
|
44
|
+
activity_name: self.props.configName,
|
45
|
+
timer: self.props.timer
|
46
|
+
});
|
39
47
|
nutella.net.publish('currentConfig/update', +self.props.configId);
|
40
48
|
};
|
41
49
|
self._timeoutId = setTimeout(action, self._timerDuration);
|
@@ -1,12 +1,16 @@
|
|
1
|
-
|
2
1
|
var React = require('react');
|
3
2
|
var Mui = require('material-ui');
|
4
3
|
var Paper = Mui.Paper;
|
5
4
|
var RaisedButton = Mui.RaisedButton;
|
5
|
+
var NutellaMixin = require('./NutellaMixin');
|
6
6
|
|
7
7
|
var Footer = React.createClass({
|
8
8
|
|
9
|
+
mixins: [NutellaMixin],
|
10
|
+
|
9
11
|
handleLogoutAll: function() {
|
12
|
+
// #LOG action
|
13
|
+
this.logAction('logoutAll', {});
|
10
14
|
nutella.net.publish('logout/all', '');
|
11
15
|
},
|
12
16
|
|
@@ -0,0 +1,57 @@
|
|
1
|
+
|
2
|
+
var NutellaMixin = {
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Stores a user interaction as a document in the MongoDB database.
|
6
|
+
* @param action name of the action fired
|
7
|
+
* @param info additional properties to be stored for the specific interaction
|
8
|
+
*/
|
9
|
+
logAction: function(action, info) {
|
10
|
+
var query_parameters = NUTELLA.parseURLParameters();
|
11
|
+
var app_id = query_parameters.app_id;
|
12
|
+
var run_id = query_parameters.run_id;
|
13
|
+
var cookie = this.getCookie('roomcast_device');
|
14
|
+
if(cookie === '') {
|
15
|
+
cookie = (+new Date * Math.random()).toString(36).substring(0, 15);
|
16
|
+
this.setCookie('roomcast_device', cookie, 365);
|
17
|
+
}
|
18
|
+
var date = new Date();
|
19
|
+
var doc = {};
|
20
|
+
doc.action = action;
|
21
|
+
doc.app_id = app_id;
|
22
|
+
doc.run_id = run_id;
|
23
|
+
doc.device_id = cookie;
|
24
|
+
doc.time = {
|
25
|
+
timestamp: date,
|
26
|
+
year: date.getFullYear(),
|
27
|
+
month: date.getMonth() + 1,
|
28
|
+
day: date.getDate(),
|
29
|
+
time: date.getHours() + ":" +date.getMinutes() + ":" +date.getSeconds()
|
30
|
+
};
|
31
|
+
if(Object.keys(info).length !== 0) {
|
32
|
+
doc.info = info;
|
33
|
+
}
|
34
|
+
nutella.net.publish('roomcast-log-bot/store', doc);
|
35
|
+
},
|
36
|
+
|
37
|
+
setCookie: function(cname, cvalue, exdays) {
|
38
|
+
var d = new Date();
|
39
|
+
d.setTime(d.getTime() + (exdays*24*60*60*1000));
|
40
|
+
var expires = "expires="+d.toUTCString();
|
41
|
+
document.cookie = cname + "=" + cvalue + "; " + expires;
|
42
|
+
},
|
43
|
+
|
44
|
+
getCookie: function(cname) {
|
45
|
+
var name = cname + "=";
|
46
|
+
var ca = document.cookie.split(';');
|
47
|
+
for(var i=0; i<ca.length; i++) {
|
48
|
+
var c = ca[i];
|
49
|
+
while (c.charAt(0)==' ') c = c.substring(1);
|
50
|
+
if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
|
51
|
+
}
|
52
|
+
return "";
|
53
|
+
}
|
54
|
+
|
55
|
+
};
|
56
|
+
|
57
|
+
module.exports = NutellaMixin;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nutella_framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Gnoli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semantic
|
@@ -851,8 +851,8 @@ files:
|
|
851
851
|
- framework_components/roomcast-teacher-controls/src/app/app.js
|
852
852
|
- framework_components/roomcast-teacher-controls/src/app/components/ActivitiesGrid.js
|
853
853
|
- framework_components/roomcast-teacher-controls/src/app/components/ActivityCard.js
|
854
|
-
- framework_components/roomcast-teacher-controls/src/app/components/Channel.js
|
855
854
|
- framework_components/roomcast-teacher-controls/src/app/components/Footer.js
|
855
|
+
- framework_components/roomcast-teacher-controls/src/app/components/NutellaMixin.js
|
856
856
|
- framework_components/roomcast-teacher-controls/src/app/components/main.js
|
857
857
|
- framework_components/roomcast-teacher-controls/src/less/main.less
|
858
858
|
- framework_components/roomcast-teacher-controls/src/less/my_overrides.less
|
@@ -1,70 +0,0 @@
|
|
1
|
-
var React = require('react');
|
2
|
-
var Mui = require('material-ui');
|
3
|
-
var Paper = Mui.Paper;
|
4
|
-
|
5
|
-
/**
|
6
|
-
* @prop channel
|
7
|
-
*/
|
8
|
-
var Channel = React.createClass({
|
9
|
-
|
10
|
-
componentDidMount: function() {
|
11
|
-
|
12
|
-
},
|
13
|
-
|
14
|
-
handleClick: function() {
|
15
|
-
|
16
|
-
// JavaScript to send an action to iOS code
|
17
|
-
var appName = 'roomcast';
|
18
|
-
var actionType = 'playChannel';
|
19
|
-
// TODO generalize
|
20
|
-
var actionParameters = {
|
21
|
-
'name': this.props.channel.name,
|
22
|
-
'url': this.props.channel.url
|
23
|
-
};
|
24
|
-
var jsonString = (JSON.stringify(actionParameters));
|
25
|
-
var escapedJsonParameters = escape(jsonString);
|
26
|
-
var url = appName + '://' + actionType + "#" + escapedJsonParameters;
|
27
|
-
console.log('launching url: ', url);
|
28
|
-
document.location.href = url;
|
29
|
-
|
30
|
-
},
|
31
|
-
|
32
|
-
render: function() {
|
33
|
-
|
34
|
-
var broker = '52.1.142.215', runId = 'RoomQuake', imgType = 'screenshot';
|
35
|
-
|
36
|
-
var style = {
|
37
|
-
backgroundImage: 'url(' + 'http://' + broker + ':57880/roomcast/main-interface/assets/channels/' + runId + '/' + imgType + '/' + this.props.channel.screenshot + ')',
|
38
|
-
backgroundSize: '100% 100%'
|
39
|
-
};
|
40
|
-
|
41
|
-
return (
|
42
|
-
<Paper className='channel' style={style} ref='channelRef' onTouchTap={this.handleClick} >
|
43
|
-
|
44
|
-
<div className='channel-div' >
|
45
|
-
|
46
|
-
<div className='channel-caption'>
|
47
|
-
|
48
|
-
<div className='icon-name-wrapper'>
|
49
|
-
|
50
|
-
<img className='channel-icon'> </img>
|
51
|
-
|
52
|
-
<div className='name-wrapper'>
|
53
|
-
<p className='channel-name'> {this.props.channel.name} </p>
|
54
|
-
<p className='channel-description'> description... </p>
|
55
|
-
</div>
|
56
|
-
|
57
|
-
</div>
|
58
|
-
|
59
|
-
</div>
|
60
|
-
|
61
|
-
</div>
|
62
|
-
|
63
|
-
</Paper>);
|
64
|
-
|
65
|
-
}
|
66
|
-
|
67
|
-
});
|
68
|
-
|
69
|
-
module.exports = Channel;
|
70
|
-
|