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.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/framework_components/monitoring-bot/monitoring-bot.rb +11 -2
  4. data/framework_components/monitoring-interface/.gitignore +2 -0
  5. data/framework_components/monitoring-interface/README.md +1 -0
  6. data/framework_components/monitoring-interface/bower.json +29 -0
  7. data/framework_components/monitoring-interface/bower_components/bower-mqttws/.bower.json +23 -0
  8. data/framework_components/monitoring-interface/bower_components/bower-mqttws/bower.json +14 -0
  9. data/framework_components/monitoring-interface/bower_components/bower-mqttws/mqttws31.js +2081 -0
  10. data/framework_components/monitoring-interface/bower_components/bower-mqttws/readme.md +4 -0
  11. data/framework_components/monitoring-interface/bower_components/nutella_lib/.bower.json +37 -0
  12. data/framework_components/monitoring-interface/bower_components/nutella_lib/LICENSE +21 -0
  13. data/framework_components/monitoring-interface/bower_components/nutella_lib/README.md +15 -0
  14. data/framework_components/monitoring-interface/bower_components/nutella_lib/bower.json +28 -0
  15. data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/browser/mqtt_client_hello_world.html +23 -0
  16. data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/browser/nutella_hello_world.html +52 -0
  17. data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/node/mqtt_client_hello_world.js +14 -0
  18. data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/node/nutella_hello_world.js +38 -0
  19. data/framework_components/monitoring-interface/bower_components/nutella_lib/nutella_lib.js +789 -0
  20. data/framework_components/monitoring-interface/bower_components/nutella_lib/package.json +30 -0
  21. data/framework_components/monitoring-interface/css/Monitoring Interface.html +215 -0
  22. data/framework_components/monitoring-interface/css/Monitoring Interface_files/animations.js +27 -0
  23. data/framework_components/monitoring-interface/css/Monitoring Interface_files/application-view-controller.js +232 -0
  24. data/framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js +61 -0
  25. data/framework_components/monitoring-interface/css/Monitoring Interface_files/bootstrap.min.js +7 -0
  26. data/framework_components/monitoring-interface/css/Monitoring Interface_files/cursor.css +7 -0
  27. data/framework_components/monitoring-interface/css/Monitoring Interface_files/d3.v3.min.js +5 -0
  28. data/framework_components/monitoring-interface/css/Monitoring Interface_files/graphics.js +156 -0
  29. data/framework_components/monitoring-interface/css/Monitoring Interface_files/grid-layout.js +103 -0
  30. data/framework_components/monitoring-interface/css/Monitoring Interface_files/highlight.min.js +2 -0
  31. data/framework_components/monitoring-interface/css/Monitoring Interface_files/instance-view-controller.js +104 -0
  32. data/framework_components/monitoring-interface/css/Monitoring Interface_files/jquery-1.10.0.min.js +6 -0
  33. data/framework_components/monitoring-interface/css/Monitoring Interface_files/notification-center.js +63 -0
  34. data/framework_components/monitoring-interface/css/Monitoring Interface_files/notifications.js +14 -0
  35. data/framework_components/monitoring-interface/css/Monitoring Interface_files/page.css +33 -0
  36. data/framework_components/monitoring-interface/css/Monitoring Interface_files/radial-layout.js +175 -0
  37. data/framework_components/monitoring-interface/css/Monitoring Interface_files/tab-table.js +8 -0
  38. data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-application.css +0 -0
  39. data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-application.js +320 -0
  40. data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-connection-view.css +10 -0
  41. data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-connection-view.js +426 -0
  42. data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-element.js +205 -0
  43. data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-notification.js +94 -0
  44. data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-tab.js +229 -0
  45. data/framework_components/monitoring-interface/css/Monitoring Interface_files/underscore-min.js +5 -0
  46. data/framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js +68 -0
  47. data/framework_components/monitoring-interface/css/Monitoring Interface_files/window-view-controller.js +169 -0
  48. data/framework_components/monitoring-interface/css/alerts.css +3 -0
  49. data/framework_components/monitoring-interface/css/bootstrap.min.css +5 -0
  50. data/framework_components/monitoring-interface/css/cursor.css +7 -0
  51. data/framework_components/monitoring-interface/css/highlight.default.min.css +1 -0
  52. data/framework_components/monitoring-interface/css/page.css +41 -0
  53. data/framework_components/monitoring-interface/css/ui-application.css +0 -0
  54. data/framework_components/monitoring-interface/css/ui-connection-view.css +10 -0
  55. data/framework_components/monitoring-interface/css/ui-legend-view.css +7 -0
  56. data/framework_components/monitoring-interface/data/alert.json +8 -0
  57. data/framework_components/monitoring-interface/data/data.json +2118 -0
  58. data/framework_components/monitoring-interface/data/data2.json +814 -0
  59. data/framework_components/monitoring-interface/data/data3.json +823 -0
  60. data/framework_components/monitoring-interface/data/data4.json +848 -0
  61. data/framework_components/monitoring-interface/data/message.json +999 -0
  62. data/framework_components/monitoring-interface/gulpfile.js +29 -0
  63. data/framework_components/monitoring-interface/img/arrow_white.svg +120 -0
  64. data/framework_components/monitoring-interface/img/arrow_white_right.svg +104 -0
  65. data/framework_components/monitoring-interface/img/back.svg +164 -0
  66. data/framework_components/monitoring-interface/img/cross_red_border_white.svg +143 -0
  67. data/framework_components/monitoring-interface/img/cross_red_border_white_mouseover.svg +143 -0
  68. data/framework_components/monitoring-interface/img/email.svg +89 -0
  69. data/framework_components/monitoring-interface/img/email_highlighted.svg +89 -0
  70. data/framework_components/monitoring-interface/index.html +144 -0
  71. data/framework_components/monitoring-interface/js/d3/layout/grid-layout.js +103 -0
  72. data/framework_components/monitoring-interface/js/d3/layout/radial-layout.js +184 -0
  73. data/framework_components/monitoring-interface/js/d3/plugin/graphics.js +156 -0
  74. data/framework_components/monitoring-interface/js/d3/plugin/tab-table.js +8 -0
  75. data/framework_components/monitoring-interface/js/d3/ui/animations.js +27 -0
  76. data/framework_components/monitoring-interface/js/d3/ui/ui-application.js +471 -0
  77. data/framework_components/monitoring-interface/js/d3/ui/ui-connection-view.js +847 -0
  78. data/framework_components/monitoring-interface/js/d3/ui/ui-element.js +245 -0
  79. data/framework_components/monitoring-interface/js/d3/ui/ui-legend.js +174 -0
  80. data/framework_components/monitoring-interface/js/d3/ui/ui-notification.js +90 -0
  81. data/framework_components/monitoring-interface/js/d3/ui/ui-tab.js +309 -0
  82. data/framework_components/monitoring-interface/js/lib/JSXTransformer-0.12.2.js +15199 -0
  83. data/framework_components/monitoring-interface/js/lib/bootstrap.min.js +7 -0
  84. data/framework_components/monitoring-interface/js/lib/d3.v3.min.js +5 -0
  85. data/framework_components/monitoring-interface/js/lib/highlight.min.js +2 -0
  86. data/framework_components/monitoring-interface/js/lib/jquery-1.10.0.min.js +6 -0
  87. data/framework_components/monitoring-interface/js/lib/nutella_lib.js +5121 -0
  88. data/framework_components/monitoring-interface/js/lib/react-with-addons-0.12.2.js +19822 -0
  89. data/framework_components/monitoring-interface/js/lib/underscore-min.js +5 -0
  90. data/framework_components/monitoring-interface/js/model/alerts-model.js +74 -0
  91. data/framework_components/monitoring-interface/js/model/applications-model.js +78 -0
  92. data/framework_components/monitoring-interface/js/model/messages-model.js +112 -0
  93. data/framework_components/monitoring-interface/js/notification/notification-center.js +63 -0
  94. data/framework_components/monitoring-interface/js/notification/notifications.js +21 -0
  95. data/framework_components/monitoring-interface/js/react/dist/ui-alerts.js +178 -0
  96. data/framework_components/monitoring-interface/js/react/dist/ui-message-send.js +389 -0
  97. data/framework_components/monitoring-interface/js/react/dist/ui-messages.js +103 -0
  98. data/framework_components/monitoring-interface/js/react/src/ui-alerts.js +178 -0
  99. data/framework_components/monitoring-interface/js/react/src/ui-message-send.js +389 -0
  100. data/framework_components/monitoring-interface/js/react/src/ui-messages.js +103 -0
  101. data/framework_components/monitoring-interface/js/view-controller/application-view-controller.js +256 -0
  102. data/framework_components/monitoring-interface/js/view-controller/instance-view-controller.js +112 -0
  103. data/framework_components/monitoring-interface/js/view-controller/view-controller.js +74 -0
  104. data/framework_components/monitoring-interface/js/view-controller/window-view-controller.js +169 -0
  105. data/framework_components/monitoring-interface/nutella.json +6 -0
  106. data/framework_components/order.json +1 -0
  107. data/framework_components/roomcast-bot/roomcast_bot.rb +139 -117
  108. data/framework_components/roomcast-channel-creator/dist/app.js +9 -7
  109. data/framework_components/roomcast-channel-creator/index.html +1 -1
  110. data/framework_components/roomcast-channel-creator/src/app/components/main.js +8 -6
  111. data/framework_components/roomcast-package-creator/dist/app.js +4 -4
  112. data/framework_components/roomcast-package-creator/index.html +1 -1
  113. data/framework_components/roomcast-package-creator/package.json +3 -3
  114. data/framework_components/roomcast-package-creator/src/app/components/ConfigurationsPanel.js +2 -2
  115. data/framework_components/roomcast-package-creator/src/app/components/PoolRow.js +1 -1
  116. data/framework_components/roomcast-teacher-controls/.gitignore +2 -0
  117. data/framework_components/roomcast-teacher-controls/README.md +9 -0
  118. data/framework_components/roomcast-teacher-controls/dist/app.js +38327 -0
  119. data/framework_components/roomcast-teacher-controls/dist/main.css +3052 -0
  120. data/framework_components/roomcast-teacher-controls/dist/nutella_lib.js +5121 -0
  121. data/framework_components/roomcast-teacher-controls/gulp/config.js +51 -0
  122. data/framework_components/roomcast-teacher-controls/gulp/tasks/browserify.js +77 -0
  123. data/framework_components/roomcast-teacher-controls/gulp/tasks/build.js +3 -0
  124. data/framework_components/roomcast-teacher-controls/gulp/tasks/css.js +7 -0
  125. data/framework_components/roomcast-teacher-controls/gulp/tasks/default.js +3 -0
  126. data/framework_components/roomcast-teacher-controls/gulp/tasks/fonts.js +7 -0
  127. data/framework_components/roomcast-teacher-controls/gulp/tasks/less.js +16 -0
  128. data/framework_components/roomcast-teacher-controls/gulp/tasks/mui-fonts.js +7 -0
  129. data/framework_components/roomcast-teacher-controls/gulp/tasks/nutella.js +7 -0
  130. data/framework_components/roomcast-teacher-controls/gulp/tasks/setWatch.js +5 -0
  131. data/framework_components/roomcast-teacher-controls/gulp/tasks/svgs.js +7 -0
  132. data/framework_components/roomcast-teacher-controls/gulp/tasks/watch.js +12 -0
  133. data/framework_components/roomcast-teacher-controls/gulp/util/bundleLogger.js +21 -0
  134. data/framework_components/roomcast-teacher-controls/gulp/util/handleErrors.js +15 -0
  135. data/framework_components/roomcast-teacher-controls/gulpfile.js +16 -0
  136. data/framework_components/roomcast-teacher-controls/index.html +51 -0
  137. data/framework_components/roomcast-teacher-controls/nutella.json +6 -0
  138. data/framework_components/roomcast-teacher-controls/package.json +38 -0
  139. data/framework_components/roomcast-teacher-controls/src/app/app.js +22 -0
  140. data/framework_components/roomcast-teacher-controls/src/app/components/ActivitiesGrid.js +87 -0
  141. data/framework_components/roomcast-teacher-controls/src/app/components/ActivityCard.js +141 -0
  142. data/framework_components/roomcast-teacher-controls/src/app/components/Channel.js +70 -0
  143. data/framework_components/roomcast-teacher-controls/src/app/components/Footer.js +34 -0
  144. data/framework_components/roomcast-teacher-controls/src/app/components/main.js +74 -0
  145. data/framework_components/roomcast-teacher-controls/src/less/main.less +186 -0
  146. data/framework_components/roomcast-teacher-controls/src/less/my_overrides.less +14 -0
  147. data/lib/commands/meta/run_command.rb +11 -9
  148. metadata +135 -2
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Class NotificationCenter
3
+ */
4
+
5
+ var NotificationCenter = function() {
6
+ var self = {};
7
+
8
+
9
+ var _callbacks = [];
10
+
11
+
12
+ /** PUBLIC FUNCTIONS**/
13
+
14
+ /**
15
+
16
+ */
17
+ self.subscribe = function(notification, callback) {
18
+ _callbacks.push({notification : notification, callback : callback});
19
+ };
20
+
21
+ self.unsubscribe = function(notification, callback) {
22
+ var index = -1;
23
+ for(var i=0; i<_callbacks.length; i++) {
24
+ var c = _callbacks[i];
25
+ if(c.notification == notification &&
26
+ c.callback == callback) {
27
+ index = i;
28
+ break;
29
+ }
30
+ }
31
+ if(index >= 0) {
32
+ _callbacks.splice(index,1);
33
+ return true;
34
+ }
35
+ else {
36
+ return false;
37
+ }
38
+
39
+
40
+ };
41
+
42
+ self.dispatch = function(notification) {
43
+ console.log("Notification center > dispatch: "+notification);
44
+ _.filter(_callbacks,
45
+ function(c){return c.notification === notification})
46
+ .forEach(
47
+ function(c){c.callback();}
48
+ );
49
+ };
50
+
51
+
52
+
53
+ var init = function() {
54
+
55
+ //initialization stuff
56
+
57
+ }();
58
+
59
+ return self;
60
+ };
61
+
62
+ //global notification center
63
+ var notificationCenter = NotificationCenter();
@@ -0,0 +1,14 @@
1
+ var Notifications = Notifications || {};
2
+
3
+ Notifications.data = {
4
+ APPLICATION_DATA_CHANGE: "data.APPLICATION_DATA_CHANGE"
5
+ };
6
+
7
+ Notifications.ui = {
8
+ INSTANCE_CLICKED: "ui.INSTANCE_CLICKED",
9
+ APPLICATION_CLICKED: "ui.APPLICATION_CLICKED",
10
+ APPLICATION_EXPANSION_STARTED: "ui.APPLICATION_EXPANSION_STARTED",
11
+ APPLICATION_REDUCTION_STARTED: "ui.APPLICATION_REDUCTION_STARTED",
12
+ APPLICATION_EXPANSION_FINISHED: "ui.APPLICATION_EXPANSION_FINISHED",
13
+ APPLICATION_REDUCTION_FINISHED: "ui.APPLICATION_REDUCTION_FINISHED",
14
+ };
@@ -0,0 +1,33 @@
1
+ body {
2
+ font-family: sans-serif;
3
+ -webkit-touch-callout: none;
4
+ -webkit-user-select: none;
5
+ -khtml-user-select: none;
6
+ -moz-user-select: none;
7
+ -ms-user-select: none;
8
+ user-select: none;
9
+ }
10
+
11
+ .modal-content {
12
+ border-radius: 0!important;
13
+ }
14
+
15
+ .btn {
16
+ border-radius: 0!important;
17
+ }
18
+
19
+ .modal-messages {
20
+ width: 80%; /* desired relative width */
21
+ /* place center */
22
+ margin-left:auto;
23
+ margin-right:auto;
24
+ }
25
+
26
+ code {
27
+ -webkit-touch-callout: default;
28
+ -webkit-user-select: text;
29
+ -khtml-user-select: text;
30
+ -moz-user-select: text;
31
+ -ms-user-select: text;
32
+ user-select: text;
33
+ }
@@ -0,0 +1,175 @@
1
+ (function() {
2
+ d3.layout.radial = function() {
3
+
4
+ // Private variables
5
+ this._numChannels = undefined;
6
+ this._numComponents = undefined;
7
+
8
+ this._margin = 0; // Margin between components in %
9
+ this._radius = undefined;
10
+ this._linkRadius = undefined;
11
+
12
+ // Public variables
13
+ this.components = undefined;
14
+ this.channels = undefined;
15
+ this.links = undefined;
16
+
17
+ this.publishChannels = undefined;
18
+ this.subscribeChannels = undefined;
19
+ this.requestChannels = undefined;
20
+ this.handleRequestChannels = undefined;
21
+
22
+
23
+ this.data = function(components) {
24
+ var self = this;
25
+
26
+ this.components = [];
27
+ this.channels = [];
28
+ this.links = [];
29
+
30
+ this.publishChannels = [];
31
+ this.subscribeChannels = [];
32
+ this.requestChannels = [];
33
+ this.handleRequestChannels = [];
34
+
35
+ this._numComponents = components.length;
36
+ var numChannels = 0;
37
+
38
+ // Clone components and calculate number of channels
39
+ components.forEach(function(component) {
40
+ numChannels += component.publish.length;
41
+ numChannels += component.subscribe.length;
42
+ numChannels += component.request.length;
43
+ numChannels += component.handle_request.length;
44
+
45
+ self.components.push(component);
46
+ });
47
+
48
+ this._numChannels = numChannels;
49
+
50
+ // Calculate angle of components
51
+ var angle = 0;
52
+ this.components.forEach(function(component) {
53
+ var numChannels = 0;
54
+ numChannels += component.publish.length;
55
+ numChannels += component.subscribe.length;
56
+ numChannels += component.request.length;
57
+ numChannels += component.handle_request.length;
58
+
59
+ var angleMargin = 2 * Math.PI * self._margin / self._numComponents;
60
+
61
+ component.startAngle = angle;
62
+ component.endAngle = angle + numChannels * 2 * Math.PI * (1.0 - self._margin) / self._numChannels;
63
+
64
+ angle = component.endAngle + angleMargin;
65
+
66
+ // Calculate angle for every channel
67
+ var deltaAngle = (component.endAngle - component.startAngle) / numChannels;
68
+ var channelAngle = component.startAngle + deltaAngle / 2.0;
69
+ component.publish.forEach(function(publish) {
70
+ publish.angle = channelAngle;
71
+ publish.radius = self._radius;
72
+ channelAngle += deltaAngle;
73
+
74
+ self.channels.push(publish);
75
+ self.publishChannels.push(publish);
76
+ });
77
+ component.subscribe.forEach(function(subscribe) {
78
+ subscribe.angle = channelAngle;
79
+ subscribe.radius = self._radius;
80
+ channelAngle += deltaAngle;
81
+
82
+ self.channels.push(subscribe);
83
+ self.subscribeChannels.push(subscribe);
84
+ });
85
+ component.request.forEach(function(request) {
86
+ request.angle = channelAngle;
87
+ request.radius = self._radius;
88
+ channelAngle += deltaAngle;
89
+
90
+ self.channels.push(request);
91
+ self.requestChannels.push(request);
92
+ });
93
+ component.handle_request.forEach(function(handleRequest) {
94
+ handleRequest.angle = channelAngle;
95
+ handleRequest.radius = self._radius;
96
+ channelAngle += deltaAngle;
97
+
98
+ self.channels.push(handleRequest);
99
+ self.handleRequestChannels.push(handleRequest);
100
+ });
101
+ });
102
+
103
+ // Calculate links
104
+ self.components.forEach(function(component1) {
105
+ component1.publish.forEach(function(publish) {
106
+ self.components.forEach(function(component2) {
107
+ component2.subscribe.forEach(function(subscribe) {
108
+ if(publish.channel == subscribe.channel) {
109
+ var link = {
110
+ type: "publish",
111
+ source: publish,
112
+ destination: subscribe,
113
+ coordinates: [
114
+ {angle: publish.angle, radius: self._linkRadius},
115
+ {angle: (publish.angle + subscribe.angle) / 2.0, radius: 0},
116
+ {angle: subscribe.angle, radius: self._linkRadius}
117
+ ]
118
+ };
119
+ self.links.push(link);
120
+ }
121
+ });
122
+ });
123
+ });
124
+
125
+ component1.request.forEach(function(request) {
126
+ self.components.forEach(function(component2) {
127
+ component2.handle_request.forEach(function(handle_request) {
128
+ if(request.channel == handle_request.channel) {
129
+ var link = {
130
+ type: "request",
131
+ source: request,
132
+ destination: handle_request,
133
+ coordinates: [
134
+ {angle: request.angle, radius: self._linkRadius},
135
+ {angle: (request.angle + handle_request.angle) / 2.0, radius: 0},
136
+ {angle: handle_request.angle, radius: self._linkRadius}
137
+ ]
138
+ };
139
+ self.links.push(link);
140
+ }
141
+ });
142
+ });
143
+ });
144
+ });
145
+
146
+ return this;
147
+ };
148
+
149
+ this.margin = function(margin) {
150
+ if(margin == undefined)
151
+ return this._margin;
152
+
153
+ this._margin = margin;
154
+ return this;
155
+ };
156
+
157
+ this.radius = function(radius) {
158
+ if(radius == undefined)
159
+ return this._radius;
160
+
161
+ this._radius = radius;
162
+ return this;
163
+ };
164
+
165
+ this.linkRadius = function(radius) {
166
+ if(radius == undefined)
167
+ return this._linkRadius;
168
+
169
+ this._linkRadius = radius;
170
+ return this;
171
+ };
172
+
173
+ return this;
174
+ };
175
+ })();
@@ -0,0 +1,8 @@
1
+ (function() {
2
+ d3.selection.prototype.tabTable = d3.selection.enter.prototype.tabTable = d3.transition.prototype.tabTable = function() {
3
+
4
+
5
+
6
+ return this;
7
+ };
8
+ })();
@@ -0,0 +1,320 @@
1
+ var UIApplication = function(delegate) {
2
+ var self = UIElement(delegate);
3
+
4
+ // Static attributes
5
+ UIApplication.style = {
6
+ margin: 10,
7
+ titleBarHeight: 50,
8
+ applicationBackgroundWidthNotExpanded: 100,
9
+ applicationBackgroundHeightNotExpanded: 100,
10
+ optionRectHeight: 20,
11
+ headerRectHeightNotExpanded: 10,
12
+ headerRectHeightExpanded: 30,
13
+ activeStatusColor: defaultPalette.state.green,
14
+ disabledStatusColor: defaultPalette.state.red
15
+ };
16
+
17
+ // Public variables
18
+ self.data = undefined;
19
+ self.expanded = false;
20
+
21
+ self.statusColor = function() {
22
+ if(self.delegate.status)
23
+ return UIApplication.style.activeStatusColor;
24
+
25
+ return UIApplication.style.disabledStatusColor;
26
+ };
27
+
28
+ self.openOptionRect = function (optionGroup) {
29
+ optionGroup
30
+ .transition()
31
+ .attr("transform", "translate(0," + UIApplication.style.optionRectHeight + ")");
32
+ };
33
+
34
+ self.closeOptionRect = function (optionGroup) {
35
+ optionGroup
36
+ .transition()
37
+ .attr("transform", "translate(0," + (- UIApplication.style.optionRectHeight) + ")");
38
+ };
39
+
40
+ // Private variables
41
+ var applicationBackground = undefined;
42
+ var nameGroup = undefined;
43
+ var optionGroup = undefined;
44
+ var optionRect = undefined;
45
+ var headerRect = undefined;
46
+ var appName = undefined;
47
+ var mailIcon = undefined;
48
+ var closeIcon = undefined;
49
+
50
+ self.render = function() {
51
+
52
+ console.log("Render: application");
53
+
54
+ var layer = self.view;
55
+
56
+ // Create option group
57
+ // it must be created before the app bg to perform the slide
58
+ if(optionGroup == undefined) {
59
+ optionGroup = layer.append("g")
60
+ .class("optionGroup");
61
+ }
62
+
63
+ // Background rect
64
+ if(applicationBackground == undefined) {
65
+ applicationBackground = layer.append("rect")
66
+ .on("mouseover", function () {
67
+ delegate.mouseOverEffect(applicationBackground, self.palette.accent1.bright);
68
+ self.openOptionRect(optionGroup);
69
+ })
70
+ .on("mouseout", function () {
71
+ delegate.mouseOutEffect(applicationBackground, self.palette.accent1.normal);
72
+ self.closeOptionRect(optionGroup);
73
+ })
74
+ .fill(self.palette.primary.normal)
75
+ .class("applicationBackground");
76
+ }
77
+
78
+ if(self.delegate.expanded) {
79
+ applicationBackground
80
+ .classRemove("pointer")
81
+ .on("click", null)
82
+ .on("mouseover", null)
83
+ .on("mouseout", null)
84
+ .transition()
85
+ .fill(self.palette.background.dark)
86
+ .margin(UIApplication.style.margin)
87
+ .width(windowViewController.width)
88
+ .height(windowViewController.height)
89
+ .x(-windowViewController.width / 2 + UIApplication.style.margin)
90
+ .y(-windowViewController.height / 2 + UIApplication.style.margin);
91
+ }
92
+ else {
93
+ applicationBackground
94
+ .class("pointer")
95
+ .on("click", function() {
96
+ delegate.clicked();
97
+ })
98
+ .on("mouseover", function() {
99
+ d3.select(this).fill(self.palette.accent1.bright);
100
+ self.openOptionRect(optionGroup);
101
+ })
102
+ .on("mouseout", function() {
103
+ d3.select(this).fill(self.palette.accent1.normal);
104
+ self.closeOptionRect(optionGroup);
105
+ })
106
+ .transition()
107
+ .fill(self.palette.accent1.normal)
108
+ .margin(undefined)
109
+ .width(UIApplication.style.applicationBackgroundWidthNotExpanded)
110
+ .height(UIApplication.style.applicationBackgroundHeightNotExpanded)
111
+ .x(-50)
112
+ .y(-50);
113
+ }
114
+
115
+ // Application name group
116
+ if(nameGroup == undefined) {
117
+ nameGroup = layer.append("g")
118
+ .class("nameGroup");
119
+ }
120
+
121
+ // Create the status rect
122
+ if(headerRect == undefined) {
123
+ headerRect = nameGroup.append("rect")
124
+ .class("no_interaction")
125
+ .class("headerRect");
126
+ }
127
+
128
+ // Update the status rect
129
+ headerRect
130
+ .fill(self.statusColor());
131
+
132
+ if(appName == undefined) {
133
+ appName = nameGroup.append("text")
134
+ .class("name")
135
+ .class("pointer")
136
+ .class("no_interaction")
137
+ .attr("text-anchor", "middle")
138
+ .fill(self.palette.text.bright);
139
+ }
140
+
141
+ appName.text(delegate.name);
142
+
143
+ // add close button
144
+ if(closeIcon == undefined) {
145
+ closeIcon = nameGroup.append("svg:image")
146
+ .attr('width', 20)
147
+ .attr('height', 20)
148
+ .attr("xlink:href", "img/cross_red_border_white.svg")
149
+ .class("closeApp")
150
+ .class("pointer")
151
+ .style("opacity", 0)
152
+ .on("click", function () {
153
+ delegate.closeButtonClicked();
154
+ });
155
+ }
156
+
157
+ if(optionRect == undefined) {
158
+ optionRect = optionGroup.append("rect")
159
+ .class("optionRect")
160
+ .class("pointer")
161
+ .on("click", function() {
162
+ alert("ciao simona")
163
+ });
164
+ }
165
+
166
+ // add mail icon to the option group
167
+ if(mailIcon == undefined) {
168
+ mailIcon = optionGroup.append("text")
169
+ .class("mailIcon")
170
+ .class("pointer")
171
+ .class("no_interaction")
172
+ .attr("text-anchor", "middle")
173
+ .fill(self.palette.text.bright)
174
+ .on("mouseover", function() {
175
+ self.openOptionRect(optionGroup);
176
+ delegate.mouseOverEffect(applicationBackground, self.palette.accent1.bright);
177
+ })
178
+ .y(UIApplication.style.applicationBackgroundHeightNotExpanded / 2 - UIApplication.style.optionRectHeight + 15)
179
+ .text("subscribe");
180
+
181
+ /*mailIcon = optionGroup.append("svg:image")
182
+ .on("mouseover", function() {
183
+ self.openOptionRect(optionGroup);
184
+ delegate.mouseOverEffect(applicationBackground, self.palette.accent1.bright);
185
+ d3.select(this).attr("xlink:href","img/email_highlighted.svg");
186
+ })
187
+ .on("mouseout", function() {
188
+ d3.select(this).attr("xlink:href","img/email.svg");
189
+ })
190
+ .on("click", function() {
191
+ alert("ciao simona");
192
+ })
193
+ .attr('width', 34)
194
+ .attr('height', 24)
195
+ .x(-17)
196
+ .y(UIApplication.style.applicationBackgroundHeightNotExpanded / 2 - UIApplication.style.optionRectHeight +1)
197
+ .attr("xlink:href", "img/email.svg")
198
+ .class("mailIcon")
199
+ .class("pointer");*/
200
+ }
201
+
202
+ // Application name
203
+ if(self.delegate.expanded) {
204
+ self.closeOptionRect(optionGroup);
205
+
206
+ // move the name
207
+ appName
208
+ .transition()
209
+ .duration(Animations.application.APPLICATION_EXPANSION.duration)
210
+ .x(0)
211
+ .y(-windowViewController.height / 2 + UIApplication.style.margin + 20);
212
+
213
+ // move the rect
214
+ headerRect
215
+ .transition()
216
+ .x(-windowViewController.width / 2 + UIApplication.style.margin )
217
+ .y(-windowViewController.height / 2 + UIApplication.style.margin)
218
+ .attr('width', windowViewController.width - UIApplication.style.margin * 2)
219
+ .transition()
220
+ .attr('height', UIApplication.style.headerRectHeightExpanded)
221
+ .transition();
222
+
223
+ // move close button
224
+ closeIcon
225
+ .on("mouseover", function() {
226
+ d3.select(this).attr("xlink:href","img/cross_red_border_white_mouseover.svg");
227
+ })
228
+ .on("mouseout", function() {
229
+ d3.select(this).attr("xlink:href","img/cross_red_border_white.svg");
230
+ })
231
+ .transition()
232
+ .x(windowViewController.width / 2 - UIApplication.style.margin - 25)
233
+ .y(-windowViewController.height / 2 + UIApplication.style.margin + 5)
234
+ .width(40)
235
+ .height(40)
236
+ .attr("xlink:href","img/cross_red_border_white.svg")
237
+ .transition()
238
+ .delay(750)
239
+ .style("opacity", 1);
240
+
241
+
242
+
243
+ }
244
+ else {
245
+ appName
246
+ .transition()
247
+ .x(0)
248
+ .y(0);
249
+
250
+ headerRect
251
+ .transition()
252
+ .attr('width', UIApplication.style.applicationBackgroundWidthNotExpanded)
253
+ .attr('height', UIApplication.style.headerRectHeightNotExpanded)
254
+ .x(-UIApplication.style.applicationBackgroundWidthNotExpanded / 2)
255
+ .y(-UIApplication.style.applicationBackgroundWidthNotExpanded / 2);
256
+
257
+ closeIcon
258
+ .on("mouseover", null)
259
+ .on("mouseout", null)
260
+ .x(0)
261
+ .y(0)
262
+ .width(0)
263
+ .height(0)
264
+ .style("opacity", 0);
265
+
266
+ optionRect
267
+ .on("mouseover", function () {
268
+ self.openOptionRect(optionGroup);
269
+ delegate.mouseOverEffect(applicationBackground, self.palette.accent1.bright);
270
+ })
271
+ .on("mouseout", function () {
272
+ self.closeOptionRect(optionGroup);
273
+ delegate.mouseOverEffect(applicationBackground, self.palette.accent1.normal);
274
+ })
275
+ .width(UIApplication.style.applicationBackgroundWidthNotExpanded)
276
+ .height(UIApplication.style.optionRectHeight)
277
+ .x( - UIApplication.style.applicationBackgroundWidthNotExpanded / 2)
278
+ .y( UIApplication.style.applicationBackgroundHeightNotExpanded / 2 - UIApplication.style.optionRectHeight)
279
+ .fill(self.palette.accent1.normal);
280
+ }
281
+
282
+ appName
283
+ .text(delegate.name);
284
+
285
+
286
+
287
+ };
288
+
289
+ self.instanceData = function(selectedInstance) {
290
+ var d = self.data.instances.filter(function(d) {
291
+ return d.name == selectedInstance
292
+ });
293
+
294
+ if(d.count == 0)
295
+ return undefined;
296
+
297
+ return d[0];
298
+ };
299
+
300
+ self.getWidth = function() {
301
+ return width - UIApplication.style.margin * 2;
302
+ };
303
+
304
+ self.getHeight = function() {
305
+ return height - UIApplication.style.margin * 2;
306
+ };
307
+
308
+ // Constructor
309
+ self.init = function() {
310
+
311
+ }();
312
+
313
+ // Destructor
314
+ self.deinit = function() {
315
+ // Place here the code for dealloc eventual objects
316
+
317
+ };
318
+
319
+ return self;
320
+ };
@@ -0,0 +1,10 @@
1
+ text.channel {
2
+ font: 10px sans-serif;
3
+ }
4
+
5
+ .link {
6
+ /*stroke: steelblue;*/
7
+ /*stroke-opacity: 1.4;*/
8
+ stroke-width: 5;
9
+ fill: none;
10
+ }