Commit a008af0eedd9339f77809885e2d205368ef7e2ce

Authored by Andrea Petta
1 parent ad18ef24

plugin update

controllets/dataset-table-controllet/dataset-table-controllet.html
@@ -258,13 +258,13 @@ @@ -258,13 +258,13 @@
258 </tr> 258 </tr>
259 <template is="dom-repeat" items="{{shownData}}"> 259 <template is="dom-repeat" items="{{shownData}}">
260 <tr class$="{{item.cssClass}}"> 260 <tr class$="{{item.cssClass}}">
261 - <template is="dom-repeat" items="{{_toArray(item)}}">  
262 - <template is="dom-if" if="{{!item.isLink}}">  
263 - <td title="{{item.value}}">{{item.value}}</td> 261 + <template is="dom-repeat" items="{{_toArray(item)}}" as="elem">
  262 + <template is="dom-if" if="{{!elem.isLink}}">
  263 + <td title="{{elem.value}}">{{elem.value}}</td>
264 </template> 264 </template>
265 - <template is="dom-if" if="{{item.isLink}}"> 265 + <template is="dom-if" if="{{elem.isLink}}">
266 <td> 266 <td>
267 - <template is="dom-repeat" items="{{item.value}}" as="user" > 267 + <template is="dom-repeat" items="{{elem.value}}" as="user" >
268 <div class="ow_avatar"> 268 <div class="ow_avatar">
269 <a href="#"> 269 <a href="#">
270 <img alt="" src="{{user}}" style="max-width: 100%;"> 270 <img alt="" src="{{user}}" style="max-width: 100%;">
@@ -275,9 +275,10 @@ @@ -275,9 +275,10 @@
275 </template> 275 </template>
276 </template> 276 </template>
277 <td> 277 <td>
278 - <paper-icon-button class="tools" icon="open-in-new" on-click="_onOpenDatasetClick"></paper-icon-button>  
279 - <paper-icon-button class="tools" icon="file-download"></paper-icon-button>  
280 - <paper-icon-button class="tools" icon="content-copy"></paper-icon-button> 278 + <paper-icon-button room_id$="{{item.ID}}" version$="{{item.VER}}" class="tools" icon="open-in-new" on-click="_onOpenDatasetClick"></paper-icon-button>
  279 + <paper-icon-button room_id$="{{item.ID}}" version$="{{item.VER}}" class="tools" icon="file-download" on-click="_onDownloadDatasetClick"></paper-icon-button>
  280 + <paper-icon-button room_id$="{{item.ID}}" version$="{{item.VER}}" class="tools" icon="content-copy" on-click="_onCopyDatasetClick"></paper-icon-button>
  281 + <paper-icon-button room_id$="{{item.ID}}" version$="{{item.VER}}" class="tools" icon="description" on-click="_onDownloadInfoClick"></paper-icon-button>
281 </td> 282 </td>
282 </tr> 283 </tr>
283 </template> 284 </template>
@@ -315,90 +316,7 @@ @@ -315,90 +316,7 @@
315 </paper-material> 316 </paper-material>
316 317
317 <paper-dialog modal id="paper_dialog"> 318 <paper-dialog modal id="paper_dialog">
318 - <data-table-controllet id="data_table_controllet" data='[{"ID":"1", "VER":"5", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
319 - {"ID":"1", "VER":"4", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
320 - {"ID":"1", "VER":"3", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
321 - {"ID":"1", "VER":"2", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
322 - {"ID":"1", "VER":"1", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
323 - {"ID":"16", "VER":"4", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
324 - {"ID":"16", "VER":"3", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
325 - {"ID":"16", "VER":"2", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
326 - {"ID":"16", "VER":"1", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
327 - {"ID":"1", "VER":"4", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
328 - {"ID":"1", "VER":"3", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
329 - {"ID":"1", "VER":"2", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
330 - {"ID":"1", "VER":"1", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
331 - {"ID":"16", "VER":"4", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
332 - {"ID":"16", "VER":"3", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
333 - {"ID":"16", "VER":"2", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
334 - {"ID":"16", "VER":"1", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
335 - {"ID":"1", "VER":"4", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
336 - {"ID":"1", "VER":"3", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
337 - {"ID":"1", "VER":"2", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
338 - {"ID":"1", "VER":"1", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
339 - {"ID":"16", "VER":"4", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
340 - {"ID":"16", "VER":"3", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
341 - {"ID":"16", "VER":"2", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
342 - {"ID":"16", "VER":"1", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
343 - {"ID":"1", "VER":"4", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
344 - {"ID":"1", "VER":"3", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
345 - {"ID":"1", "VER":"2", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
346 - {"ID":"1", "VER":"1", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
347 - {"ID":"16", "VER":"4", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
348 - {"ID":"16", "VER":"3", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
349 - {"ID":"16", "VER":"2", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
350 - {"ID":"16", "VER":"1", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
351 - {"ID":"1", "VER":"4", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
352 - {"ID":"1", "VER":"3", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
353 - {"ID":"1", "VER":"2", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
354 - {"ID":"1", "VER":"1", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
355 - {"ID":"16", "VER":"4", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
356 - {"ID":"16", "VER":"3", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
357 - {"ID":"16", "VER":"2", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
358 - {"ID":"16", "VER":"1", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
359 - {"ID":"1", "VER":"4", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
360 - {"ID":"1", "VER":"3", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
361 - {"ID":"1", "VER":"2", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
362 - {"ID":"1", "VER":"1", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
363 - {"ID":"16", "VER":"4", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
364 - {"ID":"16", "VER":"3", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
365 - {"ID":"16", "VER":"2", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
366 - {"ID":"16", "VER":"1", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
367 - {"ID":"1", "VER":"4", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
368 - {"ID":"1", "VER":"3", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
369 - {"ID":"1", "VER":"2", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
370 - {"ID":"1", "VER":"1", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
371 - {"ID":"16", "VER":"4", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
372 - {"ID":"16", "VER":"3", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
373 - {"ID":"16", "VER":"2", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
374 - {"ID":"16", "VER":"1", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
375 - {"ID":"1", "VER":"4", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
376 - {"ID":"1", "VER":"3", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
377 - {"ID":"1", "VER":"2", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
378 - {"ID":"1", "VER":"1", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
379 - {"ID":"16", "VER":"4", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
380 - {"ID":"16", "VER":"3", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
381 - {"ID":"16", "VER":"2", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
382 - {"ID":"16", "VER":"1", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
383 - {"ID":"1", "VER":"4", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
384 - {"ID":"1", "VER":"3", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
385 - {"ID":"1", "VER":"2", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
386 - {"ID":"1", "VER":"1", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
387 - {"ID":"16", "VER":"4", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
388 - {"ID":"16", "VER":"3", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
389 - {"ID":"16", "VER":"2", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
390 - {"ID":"16", "VER":"1", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
391 - {"ID":"1", "VER":"4", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
392 - {"ID":"1", "VER":"3", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
393 - {"ID":"1", "VER":"2", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
394 - {"ID":"1", "VER":"1", "USER":"http://172.16.15.77/ow_userfiles/plugins/base/avatars/avatar_1_1457965950.jpg", "Name":"Bilancio Battipaglia", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
395 - {"ID":"16", "VER":"4", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
396 - {"ID":"16", "VER":"3", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
397 - {"ID":"16", "VER":"2", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
398 - {"ID":"16", "VER":"1", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10},  
399 - {"ID":"17", "VER":"1", "USER":"https://www.google.it/images/branding/googleg/1x/googleg_standard_color_128dp.png", "Name":"Traffic Cameras", "Data":"07/06/2016", "METADATA":"Traffic, Cameras", "USED" : 10}]'>  
400 -  
401 - </data-table-controllet> 319 + <data-table-controllet id="data_table_controllet"></data-table-controllet>
402 <div class="buttons buttons_position"> 320 <div class="buttons buttons_position">
403 <paper-icon-button dialog-confirm icon="close" class="preview-close"></paper-icon-button> 321 <paper-icon-button dialog-confirm icon="close" class="preview-close"></paper-icon-button>
404 </div> 322 </div>
@@ -458,9 +376,98 @@ @@ -458,9 +376,98 @@
458 _type : function() {return ln["type_" + ln["localization"]];}, 376 _type : function() {return ln["type_" + ln["localization"]];},
459 _warning : function() {return ln["warning_" + ln["localization"]];}, 377 _warning : function() {return ln["warning_" + ln["localization"]];},
460 378
461 - _onOpenDatasetClick : function() {  
462 - this.$.paper_dialog.open();  
463 - this.$.data_table_controllet._resize(); 379 + _onDownloadInfoClick: function(e){
  380 + $.ajax({
  381 + url: ODE.ajax_coocreation_get_dataset_docs,
  382 + data: {room_id : e.target.parentElement.room_id, version : e.target.parentElement.version},
  383 + dataType: "text",
  384 + success: function(e){
  385 + var fileName = "dataset";
  386 + var uri = 'data:text/html;charset=utf-8,' + encodeURI(e);
  387 + var link = document.createElement("a");
  388 + link.href = uri;
  389 + link.style = "visibility:hidden";
  390 + link.download = fileName + ".html";
  391 + document.body.appendChild(link);
  392 + link.click();
  393 + document.body.removeChild(link);
  394 + }
  395 + });
  396 + },
  397 +
  398 + _onCopyDatasetClick: function(e) {
  399 + var base_url = window.location.origin;
  400 + window.prompt("Copy to clipboard: Ctrl+C, Enter", base_url + '/cocreation/ajax/get-dataset-by-room-id-and-version/?room_id=' + e.target.parentElement.room_id + '&version=' + e.target.parentElement.version);
  401 + },
  402 +
  403 + _onDownloadDatasetClick: function(e) {
  404 +
  405 + $.ajax({
  406 + url: ODE.ajax_coocreation_get_dataset,
  407 + data: {room_id : e.target.parentElement.room_id, version : e.target.parentElement.version},
  408 + dataType: "json",
  409 + success: function(e){
  410 + var arrData = e;
  411 + var row = "";
  412 + var CSV = "";
  413 +
  414 + for (var index in arrData[0]) {
  415 + row += index + ',';
  416 + }
  417 +
  418 + row = row.slice(0, -1);
  419 +
  420 + //append Label row with line break
  421 + CSV += row + '\r\n';
  422 + for (var i = 0; i < arrData.length; i++) {
  423 + var row = "";
  424 +
  425 + //2nd loop will extract each column and convert it in string comma-seprated
  426 + for (var index in arrData[i]) {
  427 + row += arrData[i][index] + ',';
  428 + }
  429 +
  430 + row.slice(0, row.length - 1);
  431 + //add a line break after each row
  432 + CSV += row + '\r\n';
  433 + }
  434 +
  435 + if (CSV == '') {
  436 + alert("Invalid data");
  437 + return;
  438 + }
  439 +
  440 + //Generate a file name
  441 + var fileName = "dataset";
  442 + //Initialize file format you want csv or xls
  443 + var uri = 'data:text/csv;charset=utf-8,' + encodeURI(CSV);
  444 + //this trick will generate a temp <a /> tag
  445 + var link = document.createElement("a");
  446 + link.href = uri;
  447 + link.style = "visibility:hidden";
  448 + link.download = fileName + ".csv";
  449 + document.body.appendChild(link);
  450 + link.click();
  451 + document.body.removeChild(link);
  452 + }
  453 + });
  454 + },
  455 +
  456 +
  457 + _onOpenDatasetClick : function(e) {
  458 +
  459 + var t = this;
  460 +
  461 + $.ajax({
  462 + url: ODE.ajax_coocreation_get_dataset,
  463 + data: {room_id : e.target.parentElement.room_id, version : e.target.parentElement.version},
  464 + dataType: "json",
  465 + success: function(e){
  466 + t.$.data_table_controllet.setData(e);
  467 + t.$.paper_dialog.open();
  468 + t.$.data_table_controllet._resize();
  469 + }
  470 + });
464 }, 471 },
465 472
466 setData : function(data) { 473 setData : function(data) {