Blame view

controllets/room-controllet/room-controllet.html 6.12 KB
2c581ce4   Renato De Donato   room-controllet
1
2
  <link rel="import" href="../../bower_components/polymer/polymer.html" />
  
55ba476b   Renato De Donato   page-slider room
3
4
  <link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html">
  
cae62033   Renato De Donato   room tooltip
5
6
7
8
  <link rel="import" href="../../bower_components/iron-icons/editor-icons.html">
  <link rel="import" href="../../bower_components/iron-icons/communication-icons.html">
  <link rel="import" href="../../bower_components/iron-icon/iron-icon.html">
  
99e54590   Renato De Donato   room tooltip ln
9
10
  <script src="../../locales/room_controllet_ln.js"></script>
  
2c581ce4   Renato De Donato   room-controllet
11
12
13
14
15
16
  <dom-module id="room-controllet">
  
      <template>
  
          <style is="custom-style">
  
cae62033   Renato De Donato   room tooltip
17
18
19
              iron-icon {
                  padding: 0px;
                  margin: 0px;
55ba476b   Renato De Donato   page-slider room
20
21
              }
  
cae62033   Renato De Donato   room tooltip
22
23
24
25
26
27
28
29
30
31
32
              iron-icon.this {
                  position: absolute;
                  top: -3px;
                  left: -3px;
  
                  -moz-transform: scaleX(-1);
                  -o-transform: scaleX(-1);
                  -webkit-transform: scaleX(-1);
                  transform: scaleX(-1);
                  filter: FlipH;
                  -ms-filter: "FlipH";
55ba476b   Renato De Donato   page-slider room
33
34
              }
  
cae62033   Renato De Donato   room tooltip
35
36
37
              paper-dialog {
                  margin: 0px;
              }
55ba476b   Renato De Donato   page-slider room
38
  
cae62033   Renato De Donato   room tooltip
39
40
41
42
43
44
45
              .room-tooltip {
                  font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
                  position: absolute;
                  min-width: 250px;
                  top: 49px;
                  left: 98px;
                  padding: 16px;
55ba476b   Renato De Donato   page-slider room
46
47
              }
  
cae62033   Renato De Donato   room tooltip
48
49
50
51
52
53
              .div_icon{
                  display: inline-block;
                  height: 20px;
                  width: 20px;
                  margin:4px 6px 4px 2px;
              }
55ba476b   Renato De Donato   page-slider room
54
  
cae62033   Renato De Donato   room tooltip
55
              p {
cae62033   Renato De Donato   room tooltip
56
                  margin: 0px;
b53fef03   Renato De Donato   treemap tooltip
57
                  padding: 8px 0px 0px 0px;
cae62033   Renato De Donato   room tooltip
58
                  white-space: nowrap;
2c581ce4   Renato De Donato   room-controllet
59
              }
55ba476b   Renato De Donato   page-slider room
60
  
cae62033   Renato De Donato   room tooltip
61
62
              .ptop{
                  padding-top: 0px;
980ade3e   Renato De Donato   room-controllet
63
64
              }
  
2c581ce4   Renato De Donato   room-controllet
65
66
          </style>
  
cae62033   Renato De Donato   room tooltip
67
68
          <div id={{roomId}} class$="grid-item {{roomHeight}} {{roomWidth}}" on-mouseover="_showTooltip" on-mouseout="_hideTooltip" style$="background-color: {{roomColor}};">
              <div class="room-body">{{body}}</div>
2c581ce4   Renato De Donato   room-controllet
69
70
              <div class="room-subject"><span>{{subject}}</span></div>
              <div class="room-timestamp">{{timestamp}}</div>
2c581ce4   Renato De Donato   room-controllet
71
  
cae62033   Renato De Donato   room tooltip
72
73
              <paper-dialog id="room_info" class="room-tooltip">
                  <iron-icon icon="communication:call-made" class="this" style="color: #2196F3;"></iron-icon>
99e54590   Renato De Donato   room tooltip ln
74
75
76
77
78
                  <p class="ptop">{{_thisRoom}} <b style="color: #2196F3;">{{subject}}</b>,</p>
                  <p>{{_createdBy}} <b style="color: #2196F3;">{{roomOwner}}</b> {{_has}}:</p>
                  <p><iron-icon class="div_icon" style$="background-color: {{roomColor}};"></iron-icon><b style$="color: {{roomColor}};">{{_howManyViews}} {{_views}}</b> (<b style$="color: {{roomColor}};">{{roomViews}}</b>),</p>
                  <p><iron-icon icon="editor:border-left"></iron-icon> <b>{{_howManyComments}} {{_comments}}</b> (<b>{{comments}}</b>) {{_and}}</p>
                  <p><iron-icon icon="editor:border-bottom"></iron-icon> <b>{{_howManyDatasets}} {{_datasets}}</b> (<b>{{datasets}}</b>).</p>
980ade3e   Renato De Donato   room-controllet
79
80
              </paper-dialog>
          </div>
55ba476b   Renato De Donato   page-slider room
81
  
2c581ce4   Renato De Donato   room-controllet
82
83
84
85
86
87
88
89
90
91
      </template>
  
      <script>
  
          Polymer({
  
              is : 'room-controllet',
  
              properties : {
  
55ba476b   Renato De Donato   page-slider room
92
93
94
95
96
97
                  roomId : {
                      type  : Number,
                      value : undefined
                  },
  
                  roomColor : {
2c581ce4   Renato De Donato   room-controllet
98
99
100
101
                      type  : String,
                      value : ""
                  },
  
55ba476b   Renato De Donato   page-slider room
102
                  roomHeight : {
980ade3e   Renato De Donato   room-controllet
103
104
                      type  : String,
                      value : ""
55ba476b   Renato De Donato   page-slider room
105
106
107
                  },
  
                  roomWidth : {
980ade3e   Renato De Donato   room-controllet
108
109
                      type  : String,
                      value : ""
55ba476b   Renato De Donato   page-slider room
110
111
                  },
  
cae62033   Renato De Donato   room tooltip
112
113
114
115
116
117
118
119
120
121
                  roomOwner : {
                      type  : String,
                      value : ""
                  },
  
                  roomShape : {
                      type  : Array,
                      value : undefined
                  },
  
55ba476b   Renato De Donato   page-slider room
122
                  body : {
2c581ce4   Renato De Donato   room-controllet
123
124
125
126
                      type  : String,
                      value : ""
                  },
  
55ba476b   Renato De Donato   page-slider room
127
                  subject  : {
2c581ce4   Renato De Donato   room-controllet
128
129
130
131
                      type  : String,
                      value : ""
                  },
  
55ba476b   Renato De Donato   page-slider room
132
                  timestamp : {
2c581ce4   Renato De Donato   room-controllet
133
134
135
136
                      type  : String,
                      value : ""
                  },
  
cae62033   Renato De Donato   room tooltip
137
                  roomViews : {
2c581ce4   Renato De Donato   room-controllet
138
                      type  : Number,
55ba476b   Renato De Donato   page-slider room
139
                      value : undefined
2c581ce4   Renato De Donato   room-controllet
140
141
142
143
                  },
  
                  comments : {
                      type  : Number,
55ba476b   Renato De Donato   page-slider room
144
                      value : undefined
cae62033   Renato De Donato   room tooltip
145
146
147
148
149
                  },
  
                  datasets : {
                      type  : Number,
                      value : undefined
99e54590   Renato De Donato   room tooltip ln
150
                  },
2c581ce4   Renato De Donato   room-controllet
151
  
99e54590   Renato De Donato   room tooltip ln
152
153
154
155
156
157
158
159
160
161
162
                  //LN
                  _thisRoom : { type : String },
                  _createdBy : { type : String },
                  _has : { type : String },
                  _views : { type : String },
                  _comments : { type : String },
                  _datasets : { type : String },
                  _and : { type : String },
                  _howManyViews : { type : String },
                  _howManyComments : { type : String },
                  _howManyDatasets : { type : String }
2c581ce4   Renato De Donato   room-controllet
163
164
165
              },
  
              attached : function() {
99e54590   Renato De Donato   room tooltip ln
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
                  this._translate();
              },
  
              _translate : function() {
                  room_ln["ln"] = ODE.user_language;
  
                  this._thisRoom = room_ln["thisRoom_" + room_ln["ln"]];
                  this._createdBy = room_ln["createdBy_" + room_ln["ln"]];
                  this._has = room_ln["has_" + room_ln["ln"]];
                  this._views = room_ln["views_" + room_ln["ln"]];
                  this._comments = room_ln["comments_" + room_ln["ln"]];
                  this._datasets = room_ln["datasets_" + room_ln["ln"]];
                  this._and = room_ln["and_" + room_ln["ln"]];
                  this._howManyViews = room_ln[this.roomShape[0] + "_" + room_ln["ln"]];
                  this._howManyComments = room_ln[this.roomShape[1] + "_" + room_ln["ln"]];
                  this._howManyDatasets = room_ln[this.roomShape[2] + "_" + room_ln["ln"]];
55ba476b   Renato De Donato   page-slider room
182
183
184
              },
  
              _showTooltip: function() {
cae62033   Renato De Donato   room tooltip
185
                  this.$.room_info.open();
980ade3e   Renato De Donato   room-controllet
186
187
188
              },
  
              _hideTooltip: function() {
cae62033   Renato De Donato   room tooltip
189
                  this.$.room_info.close();
2c581ce4   Renato De Donato   room-controllet
190
191
192
193
194
195
196
              }
  
          });
  
      </script>
  
  </dom-module>