Blame view

datalets/base-datalet/base-datalet.html 4.4 KB
73bcce88   luigser   COMPONENTS
1
  <!--

5e6ba8af   isisadmin   datalet doc update
2
3
4
  @license

      The MIT License (MIT)

  

94601c1f   Renato De Donato   trevieww multitable
5
      Copyright (c) 2015 Dipartimento di Informatica - Universit� di Salerno - Italy

5e6ba8af   isisadmin   datalet doc update
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  

      Permission is hereby granted, free of charge, to any person obtaining a copy

      of this software and associated documentation files (the "Software"), to deal

      in the Software without restriction, including without limitation the rights

      to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

      copies of the Software, and to permit persons to whom the Software is

      furnished to do so, subject to the following conditions:

  

      The above copyright notice and this permission notice shall be included in

      all copies or substantial portions of the Software.

  

      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

      IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

      FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

      AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

      LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,

      OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN

      THE SOFTWARE.

a1f0799c   isisadmin   datalet global re...
24
25
  -->

  

ae17a8dc   Luigi Serra   Controllet and da...
26
  <!--

950d181d   Luigi Serra   license updates
27
28
  * Developed by :

  * ROUTE-TO-PA Project - grant No 645860. - www.routetopa.eu

ae17a8dc   Luigi Serra   Controllet and da...
29
30
31
  *

  -->

  

a1f0799c   isisadmin   datalet global re...
32
33
34
  <link rel="import" href="../../bower_components/polymer/polymer.html">

  

  <!--

5e6ba8af   isisadmin   datalet doc update
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
  The `base-datalet` is the base component that includes datalet footer (with information about dataset domain and ROUTE-TO-PA project).

  Base datalet includes polymer.html and the BaseDataletBehaviors javascript file that define the datalet workcycle and the datalet base properties : dataUrl, fields and data.

  Every datalet must include this one in its `<template>` section.

  

  Example :

  

      <dom-module id="every-datalet">

          <template>

              ...

              <base-datalet data-url="{{dataUrl}}" fields="{{fields}}"></base-datalet>

              ...

          </template>

      </dom-module>

  

  @element base-datalet

  @status v0.1

  @homepage

  @group datalets

73bcce88   luigser   COMPONENTS
53
  -->

73bcce88   luigser   COMPONENTS
54
55
56
57
  

  <dom-module id="base-datalet">

      <template>

          <style>

94601c1f   Renato De Donato   trevieww multitable
58
59
60
61
62
63
64
65
66
67
68
              #base_datalet_container {

                  font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;

                  padding: 16px;

              }

              #base_datalet_rtp {

                  display: flex;

                  padding-top: 8px;

              }

              #rtp{

                  padding-top: 8px;

                  padding-right: 8px;

73bcce88   luigser   COMPONENTS
69
70
                  font-size: small;

              }

73bcce88   luigser   COMPONENTS
71
              #rtpalogo{

94601c1f   Renato De Donato   trevieww multitable
72
73
                  height:32px;

                  width: 32px;

73bcce88   luigser   COMPONENTS
74
75
76
              }

          </style>

  

94601c1f   Renato De Donato   trevieww multitable
77
78
79
80
81
82
83
84
85
86
          <div id="base_datalet_container">

              <b>Source: </b><span id="domain"></span>

              <div id="base_datalet_rtp">

                  <div id="rtp">Powered by Route-to-PA</div>

                  <div><a href="http://routetopa.eu/"><img id="rtpalogo" src="static/images/rtpalogo.png"></a></div>

              </div>

          </div>

  

          <!--<b>Source : </b><span id="domain"></span><br><br>-->

          <!--<div id="footer">Powered by Route-to-PA&nbsp&nbsp<a href="http://routetopa.eu/"><img src="static/images/rtpalogo.png" id="rtpalogo"></a></div><br>-->

73bcce88   luigser   COMPONENTS
87
88
      </template>

  

4e7eacf4   Luigi Serra   Controllets and d...
89
90
      <script src="static/js/BaseDataletBehavior.js"></script>

      <script src="static/js/WorkcycleBehavior.js"></script>

73bcce88   luigser   COMPONENTS
91
92
93
94
  

      <script>

          BaseDatalet = Polymer({

              is: 'base-datalet',

5e6ba8af   isisadmin   datalet doc update
95
96
  

              /**

94601c1f   Renato De Donato   trevieww multitable
97
               * It is called after the element�s template has been stamped and all elements inside the element�s local

5e6ba8af   isisadmin   datalet doc update
98
99
100
101
102
103
104
105
               * DOM have been configured (with values bound from parents, deserialized attributes, or else default values)

               * and had their ready method called.

               *

               * Extract the dataset domain from the entire URL and set the text content of the datalet footer.

               *

               * @method ready

               *

               */

73bcce88   luigser   COMPONENTS
106
              ready: function(){

5d6adad4   Luigi Serra   card and controll...
107
108
109
                  if(this.dataUrl != undefined){

                      this.$.domain.textContent = this.dataUrl.split("/")[0] + "//" + this.dataUrl.split("/")[2];

                  }

035bbee3   Luigi Serra   Datalets and cont...
110
111
112
113
114
115
116
              },

              /**

               * Set the domain url to show in the footer

               */

              setDomain: function(url){

                  this.$.domain.textContent = url;

  

73bcce88   luigser   COMPONENTS
117
118
119
120
              }

          });

      </script>

  </dom-module>