Blame view

controllets/select-dataset-controllet/select-dataset-controllet.html 20.3 KB
fb05b400   Renato De Donato   controllet 2.0, n...
1
  <link rel="import" href="../../bower_components/polymer/polymer.html">
a53fbbed   Renato De Donato   select-dataset ne...
2
  
34789a0e   Renato De Donato   jsdatachecker ln,...
3
  <link rel="import" href="../../bower_components/paper-material/paper-material.html" />
a53fbbed   Renato De Donato   select-dataset ne...
4
5
  <link rel="import" href="../../bower_components/paper-tabs/paper-tabs.html">
  <link rel="import" href="../../bower_components/paper-tabs/paper-tab.html">
a53fbbed   Renato De Donato   select-dataset ne...
6
7
8
  <link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
  <link rel="import" href="../../bower_components/paper-menu/paper-menu.html">
  <link rel="import" href="../../bower_components/paper-item/paper-item.html">
34789a0e   Renato De Donato   jsdatachecker ln,...
9
10
  <link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
  <link rel="import" href="../../bower_components/paper-tooltip/paper-tooltip.html">
a53fbbed   Renato De Donato   select-dataset ne...
11
  
34789a0e   Renato De Donato   jsdatachecker ln,...
12
  <link rel="import" href="../datasets-list-controllet/datasets-list-controllet.html">
a748d9bc   Renato De Donato   ala NUMBER bug
13
  
fb05b400   Renato De Donato   controllet 2.0, n...
14
  <dom-module id="select-dataset-controllet">
a748d9bc   Renato De Donato   ala NUMBER bug
15
      <template>
fb05b400   Renato De Donato   controllet 2.0, n...
16
          <style>
a53fbbed   Renato De Donato   select-dataset ne...
17
  
34789a0e   Renato De Donato   jsdatachecker ln,...
18
19
              #select_dataset_container {
                  margin-top: 8px;
a53fbbed   Renato De Donato   select-dataset ne...
20
21
              }
  
34789a0e   Renato De Donato   jsdatachecker ln,...
22
23
24
25
              #select_dataset_container * {
                  font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
                  font-size: 16px;
                  line-height: 24px;
a53fbbed   Renato De Donato   select-dataset ne...
26
27
              }
  
34789a0e   Renato De Donato   jsdatachecker ln,...
28
29
30
              #select_dataset_container #options {
                  display: flex;
                  flex-direction: row;
a53fbbed   Renato De Donato   select-dataset ne...
31
  
a53fbbed   Renato De Donato   select-dataset ne...
32
                  height: 48px;
34789a0e   Renato De Donato   jsdatachecker ln,...
33
34
35
                  padding: 0;
                  font-weight: 700;
                  background: #B6B6B6;
a53fbbed   Renato De Donato   select-dataset ne...
36
  
34789a0e   Renato De Donato   jsdatachecker ln,...
37
                  margin-top: 2px;
a53fbbed   Renato De Donato   select-dataset ne...
38
  
34789a0e   Renato De Donato   jsdatachecker ln,...
39
                  overflow: hidden;
a53fbbed   Renato De Donato   select-dataset ne...
40
41
              }
  
34789a0e   Renato De Donato   jsdatachecker ln,...
42
43
44
45
              #select_dataset_container #options_header {
                  width: calc(100% - 96px);
                  text-align: center;
                  padding: 12px 0 12px 48px;
a53fbbed   Renato De Donato   select-dataset ne...
46
47
              }
  
34789a0e   Renato De Donato   jsdatachecker ln,...
48
              #select_dataset_container .header_block {
2e94028d   Renato De Donato   ...
49
50
51
52
                  /*width: calc((100% - 48px) / 2);*/
                  /*max-width: 400px;*/
                  width: calc(50% - 24px);
                  padding:0 12px;
fb05b400   Renato De Donato   controllet 2.0, n...
53
  
34789a0e   Renato De Donato   jsdatachecker ln,...
54
                  line-height: 40px;
cd9f822e   Renato De Donato   split 1st step
55
  
34789a0e   Renato De Donato   jsdatachecker ln,...
56
                  display: none;
fb05b400   Renato De Donato   controllet 2.0, n...
57
              }
a53fbbed   Renato De Donato   select-dataset ne...
58
  
34789a0e   Renato De Donato   jsdatachecker ln,...
59
60
61
              #select_dataset_container #url {
                  padding: 0 12px 12px 12px;
                  height: 60px;
a53fbbed   Renato De Donato   select-dataset ne...
62
  
34789a0e   Renato De Donato   jsdatachecker ln,...
63
64
                  border: 2px solid #B6B6B6;
                  border-top: 0;
a748d9bc   Renato De Donato   ala NUMBER bug
65
              }
a53fbbed   Renato De Donato   select-dataset ne...
66
  
34789a0e   Renato De Donato   jsdatachecker ln,...
67
68
69
              #select_dataset_container #datasets_list_container {
                  height: calc(100% - 96px - 2px - 74px);
                  width: 100%;
a748d9bc   Renato De Donato   ala NUMBER bug
70
              }
a53fbbed   Renato De Donato   select-dataset ne...
71
  
34789a0e   Renato De Donato   jsdatachecker ln,...
72
73
              paper-tabs {
                  background: #B6B6B6;
fb05b400   Renato De Donato   controllet 2.0, n...
74
              }
fb05b400   Renato De Donato   controllet 2.0, n...
75
  
34789a0e   Renato De Donato   jsdatachecker ln,...
76
77
78
              paper-tab {
                  font-weight: 700;
                  border-right: 2px solid #FFFFFF;
a53fbbed   Renato De Donato   select-dataset ne...
79
              }
a748d9bc   Renato De Donato   ala NUMBER bug
80
  
2e94028d   Renato De Donato   ...
81
              paper-tab:nth-last-child(2) {
34789a0e   Renato De Donato   jsdatachecker ln,...
82
                  border-right: 0;
a53fbbed   Renato De Donato   select-dataset ne...
83
              }
a748d9bc   Renato De Donato   ala NUMBER bug
84
  
34789a0e   Renato De Donato   jsdatachecker ln,...
85
86
87
              paper-tab.iron-selected {
                  color: #FFFFFF;
                  background: #2196F3;;
a53fbbed   Renato De Donato   select-dataset ne...
88
              }
a748d9bc   Renato De Donato   ala NUMBER bug
89
  
34789a0e   Renato De Donato   jsdatachecker ln,...
90
91
              paper-tab:not(.iron-selected):hover {
                  color: #2196F3;
cd9f822e   Renato De Donato   split 1st step
92
93
              }
  
34789a0e   Renato De Donato   jsdatachecker ln,...
94
95
              paper-input {
                  --paper-input-container-focus-color: #2196F3;
cd9f822e   Renato De Donato   split 1st step
96
97
              }
  
34789a0e   Renato De Donato   jsdatachecker ln,...
98
99
100
101
              paper-icon-button {
                  height: 48px;
                  width: 48px;
                  padding: 8px;
cd9f822e   Renato De Donato   split 1st step
102
103
              }
  
34789a0e   Renato De Donato   jsdatachecker ln,...
104
105
106
107
              paper-icon-button[icon="settings"] {
                  cursor: pointer;
                  color: #00BCD4;
                  --paper-icon-button-ink-color: #00BCD4;
a748d9bc   Renato De Donato   ala NUMBER bug
108
  
34789a0e   Renato De Donato   jsdatachecker ln,...
109
110
111
112
                  background: #E0E0E0;
                  float: right;
                  position: absolute;
                  right: 0;
a748d9bc   Renato De Donato   ala NUMBER bug
113
114
              }
  
34789a0e   Renato De Donato   jsdatachecker ln,...
115
116
              paper-icon-button[icon="info-outline"] {
                  cursor: help;
a53fbbed   Renato De Donato   select-dataset ne...
117
              }
a748d9bc   Renato De Donato   ala NUMBER bug
118
  
34789a0e   Renato De Donato   jsdatachecker ln,...
119
120
121
122
123
124
125
              :host {
              --paper-dropdown-menu-icon: {
                   color: #000000;
               };
              --paper-dropdown-menu-ripple: {
                   color: #FFFFFF;
               };
3388b02b   Renato De Donato   shadow x Andrea
126
127
              }
  
34789a0e   Renato De Donato   jsdatachecker ln,...
128
              paper-dropdown-menu {
2e94028d   Renato De Donato   ...
129
130
                  /*width: 200px;*/
                  width: 50%;
34789a0e   Renato De Donato   jsdatachecker ln,...
131
                  --paper-input-container-focus-color: #2196F3;
3388b02b   Renato De Donato   shadow x Andrea
132
133
              }
  
34789a0e   Renato De Donato   jsdatachecker ln,...
134
135
136
              paper-item {
                  min-width: 128px;
                  white-space: nowrap;
a53fbbed   Renato De Donato   select-dataset ne...
137
138
              }
  
34789a0e   Renato De Donato   jsdatachecker ln,...
139
140
141
              paper-item.iron-selected {
                  background-color: #2196F3;
                  color: #FFFFFF;
a748d9bc   Renato De Donato   ala NUMBER bug
142
              }
a53fbbed   Renato De Donato   select-dataset ne...
143
  
34789a0e   Renato De Donato   jsdatachecker ln,...
144
145
146
              paper-tooltip {
                  min-width: 400px;
                  --paper-tooltip-background: black;
a53fbbed   Renato De Donato   select-dataset ne...
147
148
              }
  
34789a0e   Renato De Donato   jsdatachecker ln,...
149
150
151
152
              #select_dataset_container br {
                  display: block;
                  margin-top: 8px;
                  content: " ";
a748d9bc   Renato De Donato   ala NUMBER bug
153
154
              }
  
34789a0e   Renato De Donato   jsdatachecker ln,...
155
156
157
              #select_dataset_container p {
                  margin: 0;
                  padding: 0;
a53fbbed   Renato De Donato   select-dataset ne...
158
159
              }
  
34789a0e   Renato De Donato   jsdatachecker ln,...
160
161
162
              #select_dataset_container p .option {
                  color: #2196F3;;
                  font-weight: 700;
a53fbbed   Renato De Donato   select-dataset ne...
163
164
              }
  
34789a0e   Renato De Donato   jsdatachecker ln,...
165
              #select_dataset_container p .description {
a53fbbed   Renato De Donato   select-dataset ne...
166
              }
c5fa9cdb   Renato De Donato   info style
167
  
a748d9bc   Renato De Donato   ala NUMBER bug
168
169
          </style>
  
a53fbbed   Renato De Donato   select-dataset ne...
170
          <paper-material id="select_dataset_container" elevation="5">
34789a0e   Renato De Donato   jsdatachecker ln,...
171
172
173
              <paper-tabs selected={{tabIndex}} no-bar>
                  <paper-tab noink on-tap="_setProvidersDatasets"><span id="providers_datasets"></span></paper-tab>
                  <paper-tab noink on-tap="_setLocalDatasets"><span id="spod_users_datasets"></span></paper-tab>
2e94028d   Renato De Donato   ...
174
                  <paper-tab noink on-tap="_setExtendedDatasets"><span id="extended_datasets"></span></paper-tab>
a53fbbed   Renato De Donato   select-dataset ne...
175
              </paper-tabs>
a748d9bc   Renato De Donato   ala NUMBER bug
176
  
34789a0e   Renato De Donato   jsdatachecker ln,...
177
178
179
180
181
182
              <div id="options">
  
                  <div id="options_header"></div>
  
                  <div id="provider_option" class="header_block">
                      {{_getLocalization('provider')}}:&nbsp;
a53fbbed   Renato De Donato   select-dataset ne...
183
                      <paper-dropdown-menu id="ddl_provider" label="" no-label-float>
34789a0e   Renato De Donato   jsdatachecker ln,...
184
185
186
187
                          <paper-menu id="menu_provider" class="dropdown-content">
                              <paper-item id="0" on-tap="_setProvidersDatasets"><span id="all"></span></paper-item>
                              <template is="dom-repeat" items={{_toArray(providers)}}>
                                  <paper-item id={{item.value.id}} on-tap="_setProvidersDatasets">{{item.value.title}}</paper-item>
a53fbbed   Renato De Donato   select-dataset ne...
188
189
190
                              </template>
                          </paper-menu>
                      </paper-dropdown-menu>
34789a0e   Renato De Donato   jsdatachecker ln,...
191
192
193
194
195
196
197
198
199
                      <paper-icon-button id="info_provider" icon="info-outline" noink></paper-icon-button>
                      <paper-tooltip id="tooltip_provider" for="info_provider" offset="8">
                          <p>
                              <span class="option">{{_getLocalization('all')}}</span><br>
                              <span class="description">{{_getLocalization('allDescription')}}</span><br>
                              <span class="option">{{_getLocalization('providerName')}}</span><br>
                              <span class="description">{{_getLocalization('providerNameDescription')}}</span><br>
                          </p>
                      </paper-tooltip>
a53fbbed   Renato De Donato   select-dataset ne...
200
                  </div>
34789a0e   Renato De Donato   jsdatachecker ln,...
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
  
                  <!--<div id="view_option" class="header_block">-->
                      <!--{{_getLocalization('view')}}:&nbsp;-->
                      <!--<paper-dropdown-menu id="ddl_view" label="" no-label-float>-->
                          <!--<paper-menu id="menu_view" class="dropdown-content">-->
                              <!--<paper-item id="0" on-tap=""><span id="list"></span></paper-item>-->
                              <!--<paper-item id="1" on-tap="" disabled><span id="tree"></span></paper-item>-->
                          <!--</paper-menu>-->
                      <!--</paper-dropdown-menu>-->
                      <!--<paper-icon-button id="info_view" icon="info-outline" noink></paper-icon-button>-->
                      <!--<paper-tooltip id="tooltip_view" for="info_view" offset="8">-->
                          <!--<p>-->
                              <!--<span class="option">{{_getLocalization('list')}}</span><br>-->
                              <!--<span class="description">{{_getLocalization('listDescription')}}</span><br>-->
                              <!--<span class="option">{{_getLocalization('tree')}}</span><br>-->
                              <!--<span class="description">{{_getLocalization('treeDescription')}}</span><br>-->
                          <!--</p>-->
                      <!--</paper-tooltip>-->
                  <!--</div>-->
  
2e94028d   Renato De Donato   ...
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
                  <!--<div id="search_option" class="header_block">-->
                      <!--{{_getLocalization('search')}}:&nbsp;-->
                      <!--<paper-dropdown-menu id="ddl_search" label="" no-label-float>-->
                          <!--<paper-menu id="menu_search" class="dropdown-content">-->
                              <!--<paper-item><span id="standard"></span></paper-item>-->
                              <!--<paper-item disabled><span id="extended"></span></paper-item>-->
                          <!--</paper-menu>-->
                      <!--</paper-dropdown-menu>-->
                      <!--<paper-icon-button id="info_search" icon="info-outline" noink></paper-icon-button>-->
                      <!--<paper-tooltip id="tooltip_search" for="info_search" offset="8">-->
                          <!--<p>-->
                              <!--<span class="option">{{_getLocalization('standard')}}</span><br>-->
                              <!--<span class="description">{{_getLocalization('standardDescription')}}</span><br>-->
                              <!--<span class="option">{{_getLocalization('extended')}}</span><br>-->
                              <!--<span class="description">{{_getLocalization('extendedDescription')}}</span><br>-->
                          <!--</p>-->
                      <!--</paper-tooltip>-->
                  <!--</div>-->
34789a0e   Renato De Donato   jsdatachecker ln,...
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
  
                  <div id="version_option" class="header_block">
                      {{_getLocalization('version')}}:&nbsp;
                      <paper-dropdown-menu id="ddl_version" label="" no-label-float>
                          <paper-menu id="menu_version" class="dropdown-content">
                              <paper-item id="0" on-tap="_showLast"><span id="show_last"></span></paper-item>
                              <paper-item id="1" on-tap="_showAll"><span id="show_all"></span></paper-item>
                          </paper-menu>
                      </paper-dropdown-menu>
                      <paper-icon-button id="tooltip_version" icon="info-outline" noink></paper-icon-button>
                      <paper-tooltip id="tooltip_version" for="tooltip_version" offset="8">
                          <p>
                              <span class="option">{{_getLocalization('showLast')}}</span><br>
                              <span class="description">{{_getLocalization('showLastDescription')}}</span><br>
                              <span class="option">{{_getLocalization('showAll')}}</span><br>
                              <span class="description">{{_getLocalization('showAllDescription')}}</span><br>
                          </p>
                      </paper-tooltip>
a53fbbed   Renato De Donato   select-dataset ne...
257
                  </div>
34789a0e   Renato De Donato   jsdatachecker ln,...
258
  
2e94028d   Renato De Donato   ...
259
                  <!--<paper-icon-button icon="settings" on-click="_optionsMenu"></paper-icon-button>-->
34789a0e   Renato De Donato   jsdatachecker ln,...
260
  
a748d9bc   Renato De Donato   ala NUMBER bug
261
262
              </div>
  
34789a0e   Renato De Donato   jsdatachecker ln,...
263
264
              <div id="datasets_list_container">
                  <datasets-list-controllet id="datasets_list"></datasets-list-controllet>
a748d9bc   Renato De Donato   ala NUMBER bug
265
266
              </div>
  
34789a0e   Renato De Donato   jsdatachecker ln,...
267
              <div id="url"><paper-input id="selected_url" label="" value={{dataUrl}} error-message={{errorMessage}}></paper-input></div>
a53fbbed   Renato De Donato   select-dataset ne...
268
          </paper-material>
a748d9bc   Renato De Donato   ala NUMBER bug
269
270
271
272
  
      </template>
  
      <script>
fb05b400   Renato De Donato   controllet 2.0, n...
273
274
275
          HTMLImports.whenReady(function() {
              Polymer({
                  is: 'select-dataset-controllet',
34789a0e   Renato De Donato   jsdatachecker ln,...
276
  
fb05b400   Renato De Donato   controllet 2.0, n...
277
                  properties: {
34789a0e   Renato De Donato   jsdatachecker ln,...
278
279
280
281
282
283
  
                      tabIndex: {
                          type: Number,
                          value: 0
                      },
  
a53fbbed   Renato De Donato   select-dataset ne...
284
285
286
287
                      datasets: {
                          type: Object,
                          value: undefined
                      },
34789a0e   Renato De Donato   jsdatachecker ln,...
288
  
a53fbbed   Renato De Donato   select-dataset ne...
289
290
291
292
293
                      suggestedDatasets : {
                          type : Array,
                          value : undefined
                      },
  
a53fbbed   Renato De Donato   select-dataset ne...
294
295
296
297
                      dataUrl : {
                          type  : String,
                          value : undefined,
                          observer : '_fireDataUrl'
fb05b400   Renato De Donato   controllet 2.0, n...
298
                      }
34789a0e   Renato De Donato   jsdatachecker ln,...
299
  
a748d9bc   Renato De Donato   ala NUMBER bug
300
                  },
a53fbbed   Renato De Donato   select-dataset ne...
301
302
  
                  listeners: {
34789a0e   Renato De Donato   jsdatachecker ln,...
303
                      'datasets-list-controllet_dataset' : '_selectDataUrl'
a53fbbed   Renato De Donato   select-dataset ne...
304
305
                  },
  
fb05b400   Renato De Donato   controllet 2.0, n...
306
                  ready : function() {
34789a0e   Renato De Donato   jsdatachecker ln,...
307
308
                      this._translate();
  
fb05b400   Renato De Donato   controllet 2.0, n...
309
                      $(this.$.list_container).perfectScrollbar();
cd9f822e   Renato De Donato   split 1st step
310
                      $(this.$.info).perfectScrollbar();
a53fbbed   Renato De Donato   select-dataset ne...
311
  
2e94028d   Renato De Donato   ...
312
                      this.options = true;
a748d9bc   Renato De Donato   ala NUMBER bug
313
314
                  },
  
34789a0e   Renato De Donato   jsdatachecker ln,...
315
316
317
                  attached : function() {
                      this._translate();
  
a53fbbed   Renato De Donato   select-dataset ne...
318
319
                      this._resize();
                      var that = this;
34789a0e   Renato De Donato   jsdatachecker ln,...
320
                      window.addEventListener("resize", function() { that._resize() });
a53fbbed   Renato De Donato   select-dataset ne...
321
  
34789a0e   Renato De Donato   jsdatachecker ln,...
322
323
324
325
326
                      this.providers = this.datasets["result"]["providers"];
                      this.providersDatasets = this.datasets["result"]["datasets"];
  
                      if(this.suggestedDatasets)
                          this.providersDatasets = this.suggestedDatasets.concat(this.providersDatasets);
a53fbbed   Renato De Donato   select-dataset ne...
327
  
00210b7a   Renato De Donato   controllet SPOD p...
328
329
330
                      $.ajax({
                          url: "/cocreation/ajax/get-all-dataset",
                          dataType: "json",
34789a0e   Renato De Donato   jsdatachecker ln,...
331
332
333
334
335
336
337
338
339
340
341
342
343
                          success: function(localDatasets){
                              that.localDatasets = localDatasets;
                              that.lastLocalDatasets = [];
                              var resource_name = "";
                              for(var i in localDatasets)
                                  if(localDatasets[i].resource_name != resource_name) {
                                      that.lastLocalDatasets.push(localDatasets[i]);
                                      resource_name = localDatasets[i].resource_name;
                                  }
                          },
                          error: function(){
                              that.localDatasets = [];
                              that.lastLocalDatasets = [];
00210b7a   Renato De Donato   controllet SPOD p...
344
345
                          }
                      });
a53fbbed   Renato De Donato   select-dataset ne...
346
  
34789a0e   Renato De Donato   jsdatachecker ln,...
347
348
                      this._setProvidersDatasets();
                  },
a53fbbed   Renato De Donato   select-dataset ne...
349
  
34789a0e   Renato De Donato   jsdatachecker ln,...
350
351
352
                  showDatasetInfo : function() {
                      this.$.datasets_list.showDatasetInfo();
                  },
a53fbbed   Renato De Donato   select-dataset ne...
353
  
34789a0e   Renato De Donato   jsdatachecker ln,...
354
                  _translate : function(){
a53fbbed   Renato De Donato   select-dataset ne...
355
356
                      this.$.selected_url.setAttribute("label", ln["selectedUrl_" + ln["localization"]]);
                      this.errorMessage = ln["wrongUrl_" + ln["localization"]];
a53fbbed   Renato De Donato   select-dataset ne...
357
  
34789a0e   Renato De Donato   jsdatachecker ln,...
358
359
                      this.$.providers_datasets.innerHTML = ln["providersDatasets_" + ln["localization"]];
                      this.$.spod_users_datasets.innerHTML = ln["spodUsersDatasets_" + ln["localization"]];
2e94028d   Renato De Donato   ...
360
                      this.$.extended_datasets.innerHTML = ln["extendedDatasets_" + ln["localization"]];
4710a0b6   Renato De Donato   cocreation card
361
  
34789a0e   Renato De Donato   jsdatachecker ln,...
362
363
364
365
366
                      this.$.options_header.innerHTML = ln["datasets_" + ln["localization"]];
  
                      this.$.all.innerHTML = ln["all_" + ln["localization"]];
  //                    this.$.list.innerHTML = ln["list_" + ln["localization"]];
  //                    this.$.tree.innerHTML = ln["tree_" + ln["localization"]];
2e94028d   Renato De Donato   ...
367
368
  //                    this.$.standard.innerHTML = ln["standard_" + ln["localization"]];
  //                    this.$.extended.innerHTML = ln["extended_" + ln["localization"]];
34789a0e   Renato De Donato   jsdatachecker ln,...
369
370
371
372
373
                      this.$.show_last.innerHTML = ln["showLast_" + ln["localization"]];
                      this.$.show_all.innerHTML = ln["showAll_" + ln["localization"]];
  
                      this.$.menu_provider.select(0);
  //                    this.$.menu_view.select(0);
2e94028d   Renato De Donato   ...
374
  //                    this.$.menu_search.select(0);
34789a0e   Renato De Donato   jsdatachecker ln,...
375
                      this.$.menu_version.select(0);
a53fbbed   Renato De Donato   select-dataset ne...
376
377
                  },
  
34789a0e   Renato De Donato   jsdatachecker ln,...
378
379
380
381
382
383
384
385
                  _setProvidersDatasets : function() {
                      this.async(function () {
                          var ddl_provider = $(this.$.ddl_provider).find("paper-menu")[0].selectedItem;
                          var name = ddl_provider.innerHTML.trim();
                          var id = this._getIdByProviderName(name);
                          if (id) {
                              var providerDatasets = this.providersDatasets.filter(function (el) {
                                  return el.provider_name == "p:" + id;
a53fbbed   Renato De Donato   select-dataset ne...
386
                              });
34789a0e   Renato De Donato   jsdatachecker ln,...
387
388
389
390
                              this.$.datasets_list.setDatasets(providerDatasets);
                          }
                          else
                              this.$.datasets_list.setDatasets(this.providersDatasets);
a53fbbed   Renato De Donato   select-dataset ne...
391
  
2e94028d   Renato De Donato   ...
392
                          this._showOptions();
34789a0e   Renato De Donato   jsdatachecker ln,...
393
                      }, 0);
a748d9bc   Renato De Donato   ala NUMBER bug
394
                  },
a53fbbed   Renato De Donato   select-dataset ne...
395
  
2e94028d   Renato De Donato   ...
396
397
398
399
400
401
402
403
404
405
406
407
408
                  _setLocalDatasets : function() {
                      if(this.$.ddl_version.selectedItem.id == 0)
                          this._showLast();
                      else
                          this._showAll();
                      this._showOptions();
                  },
  
                  _setExtendedDatasets : function() {
                      this.$.datasets_list.setDatasets([]);//tutto molto bello, clap, clap, clapĆ¹
                      this._showOptions()
                  },
  
a53fbbed   Renato De Donato   select-dataset ne...
409
410
411
412
413
414
415
                  _getIdByProviderName : function(name) {
                      for(var id in this.providers) {
                          if (this.providers[id].title == name)
                              return this.providers[id].id;
                      }
                  },
  
34789a0e   Renato De Donato   jsdatachecker ln,...
416
417
418
                  _optionsMenu : function() {
                      this.options = !this.options;
                      this._showOptions();
a53fbbed   Renato De Donato   select-dataset ne...
419
420
                  },
  
34789a0e   Renato De Donato   jsdatachecker ln,...
421
422
423
424
425
426
                  _showOptions : function() {
                      this.async(function () {
                          if(!this.options) {
                              this.$.options_header.style.display = "block";
                              this.$.provider_option.style.display = "none";
  //                            this.$.view_option.style.display = "none";
2e94028d   Renato De Donato   ...
427
  //                            this.$.search_option.style.display = "none";
34789a0e   Renato De Donato   jsdatachecker ln,...
428
429
430
431
432
433
                              this.$.version_option.style.display = "none";
                          }
                          else if(this.tabIndex == 0) {
                              this.$.options_header.style.display = "none";
                              this.$.provider_option.style.display = "block";
  //                            this.$.view_option.style.display = "block";
2e94028d   Renato De Donato   ...
434
  //                            this.$.search_option.style.display = "block";
34789a0e   Renato De Donato   jsdatachecker ln,...
435
436
437
438
439
440
                              this.$.version_option.style.display = "none";
                          }
                          else if(this.tabIndex == 1) {
                              this.$.options_header.style.display = "none";
                              this.$.provider_option.style.display = "none";
  //                            this.$.view_option.style.display = "none";
2e94028d   Renato De Donato   ...
441
  //                            this.$.search_option.style.display = "none";
34789a0e   Renato De Donato   jsdatachecker ln,...
442
443
                              this.$.version_option.style.display = "block";
                          }
2e94028d   Renato De Donato   ...
444
                          else if(this.tabIndex == 2) {
4710a0b6   Renato De Donato   cocreation card
445
                              this.$.options_header.style.display = "block";
2e94028d   Renato De Donato   ...
446
447
448
449
450
                              this.$.provider_option.style.display = "none";
  //                            this.$.view_option.style.display = "none";
  //                            this.$.search_option.style.display = "none";
                              this.$.version_option.style.display = "none";
                          }
34789a0e   Renato De Donato   jsdatachecker ln,...
451
                      }, 0);
a53fbbed   Renato De Donato   select-dataset ne...
452
453
                  },
  
34789a0e   Renato De Donato   jsdatachecker ln,...
454
455
456
                  _showAll : function() {
                      this.$.datasets_list.showVersion(true);
                      this.$.datasets_list.setDatasets(this.localDatasets);
a53fbbed   Renato De Donato   select-dataset ne...
457
458
                  },
  
34789a0e   Renato De Donato   jsdatachecker ln,...
459
460
461
                  _showLast : function() {
                      this.$.datasets_list.showVersion(false);
                      this.$.datasets_list.setDatasets(this.lastLocalDatasets);
a53fbbed   Renato De Donato   select-dataset ne...
462
463
                  },
  
34789a0e   Renato De Donato   jsdatachecker ln,...
464
465
                  _getLocalization : function(text){
                      return ln[text + "_" + ln["localization"]];
a53fbbed   Renato De Donato   select-dataset ne...
466
467
468
469
470
471
472
473
474
475
476
                  },
  
                  _toArray: function(obj) {
                      return Object.keys(obj).map(function(key) {
                          return {
                              name: key,
                              value: obj[key]
                          };
                      });
                  },
  
34789a0e   Renato De Donato   jsdatachecker ln,...
477
                  _selectDataUrl : function(e){
a53fbbed   Renato De Donato   select-dataset ne...
478
                      this.async(function () {
34789a0e   Renato De Donato   jsdatachecker ln,...
479
                          this.dataUrl = e.detail.dataset.url;
a53fbbed   Renato De Donato   select-dataset ne...
480
481
482
                      }, 0);
                  },
  
a53fbbed   Renato De Donato   select-dataset ne...
483
                  _fireDataUrl : function(){
34789a0e   Renato De Donato   jsdatachecker ln,...
484
                      this.fire('select-dataset-controllet_data-url', {url: this.dataUrl});
a53fbbed   Renato De Donato   select-dataset ne...
485
486
                  },
  
a53fbbed   Renato De Donato   select-dataset ne...
487
488
489
490
                  _resize : function(){
                      var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0) - 16;
                      h = h - 64 - 8; //height with page scroller
                      $("#select_dataset_container").height(h);
a748d9bc   Renato De Donato   ala NUMBER bug
491
                  }
fb05b400   Renato De Donato   controllet 2.0, n...
492
              });
a748d9bc   Renato De Donato   ala NUMBER bug
493
          });
a748d9bc   Renato De Donato   ala NUMBER bug
494
      </script>
a748d9bc   Renato De Donato   ala NUMBER bug
495
  </dom-module>