Blame view

controllets/providers-utility-controllet/providers-utility-controllet.html 1.67 KB
89558a41   Renato De Donato   datatype, provide...
1
2
  <link rel="import" href="../../bower_components/polymer/polymer.html" />
  
25201c03   Renato De Donato   spinner, geojsonPure
3
4
  <script type="text/javascript" src="../../bower_components/jsdatachecker/jsdatachecker.min.js"></script>
  
89558a41   Renato De Donato   datatype, provide...
5
6
7
8
9
10
11
12
13
  <script src="ckan.js"></script>
  <script src="openDataSoft.js"></script>
  <script src="generic.js"></script>
  
  <script>
      var providerFactory = {
          getProvider: function(dataUrl) {
              if (dataUrl.indexOf("datastore_search?resource_id") > -1)
                  return new ckan_Provider();
ba2d39b1   Andrea Petta   plugin update
14
              else if (dataUrl.indexOf("search?dataset") > -1 || dataUrl.indexOf("search/?dataset") > -1)
89558a41   Renato De Donato   datatype, provide...
15
16
                  return new openDataSoft_Provider();
              else
ce415fab   Renato De Donato   new-bug
17
                  return new generic_Provider();
89558a41   Renato De Donato   datatype, provide...
18
19
20
          }
      };
  
0f4f5f1b   Renato De Donato   new datalets mult...
21
22
      //utility non legato al provider, aggiungere copy e creare un altro js!!!
  
89558a41   Renato De Donato   datatype, provide...
23
24
25
26
27
28
      //jsdatachecker
      utility_getFields = function(types) {
          return Object.keys(types).map(function(key) { return key; });
      };
  
      utility_getSelectedFields = function(fields, indices) {
4f438cd9   Renato De Donato   datalets-modifier
29
          var selectedFileds = [];
89558a41   Renato De Donato   datatype, provide...
30
31
32
33
34
          for (var i = 0; i < indices.length; i++)
              selectedFileds.push(fields[indices[i]]);
          return selectedFileds;
      };
  
4f438cd9   Renato De Donato   datalets-modifier
35
      utility_getSelectedIndices = function(fields, selectedFileds) {
4f438cd9   Renato De Donato   datalets-modifier
36
          var selectedIndices = [];
2f01c2f6   Renato De Donato   preselect bug
37
38
39
          for (var i = 0; i < selectedFileds.length; i++)
              if($.inArray(selectedFileds[i], fields) > -1)
                  selectedIndices.push(fields.indexOf(selectedFileds[i]));
4f438cd9   Renato De Donato   datalets-modifier
40
41
42
          return selectedIndices;
      };
  
0f4f5f1b   Renato De Donato   new datalets mult...
43
  
89558a41   Renato De Donato   datatype, provide...
44
45
46
47
48
49
50
51
52
53
54
55
56
  </script>
  
  <dom-module id="providers-utility-controllet">
  
      <template></template>
  
      <script>
          Polymer({
              is : 'providers-utility-controllet',
          });
      </script>
  
  </dom-module>