Blame view

controllets/paper-card-controllet/paper-card-controllet.html 8.75 KB
eb240478   Luigi Serra   public room cards...
1
  <link rel="import" href="../../bower_components/polymer/polymer.html"/>

1b49624d   isisadmin   paper-card-contro...
2
3
4
  <link rel="import" href="../../bower_components/paper-material/paper-material.html"/>

  <link rel="import" href="../../bower_components/paper-fab/paper-fab.html"/>

  <link rel="import" href="../../bower_components/iron-icons/iron-icons.html"/>

b4190b56   Renato De Donato   myspace update
5
6
  <link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html"/>

  <link rel="import" href="../../bower_components/neon-animation/neon-animation.html"/>

1b49624d   isisadmin   paper-card-contro...
7
  

2813afd7   Renato De Donato   locales ln mod
8
  <script src="../../locales/paper_card_controllet_ln.js"></script>

ed70e2e2   Andrea Petta   tooltip internati...
9
  

1b49624d   isisadmin   paper-card-contro...
10
11
  <dom-module id="paper-card-controllet">

  

1b49624d   isisadmin   paper-card-contro...
12
      <template>

eb240478   Luigi Serra   public room cards...
13
14
15
          <link rel="stylesheet" href="../shared_js/perfect-scrollbar/css/perfect-scrollbar.min.css">

          <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>

          <style>

eb240478   Luigi Serra   public room cards...
16
  

b4190b56   Renato De Donato   myspace update
17
18
19
              #paper_card_container {

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

                  font-size: 16px;

c94733d2   Renato De Donato   paper-card modify
20
                  line-height: 16px;

eb240478   Luigi Serra   public room cards...
21
22
              }

  

b4190b56   Renato De Donato   myspace update
23
              #content {

c94733d2   Renato De Donato   paper-card modify
24
25
26
27
28
29
30
31
32
33
                  width: 100%;

                  height: calc(100% - 64px);

                  overflow: hidden;

              }

  

              #content.text {

                  background-color: #FFFFCC;

                  padding: 4px;

                  width: calc(100% - 8px);

                  height: calc(100% - 72px);

eb240478   Luigi Serra   public room cards...
34
              }

7383b38e   Luigi Serra   paper-card-contro...
35
  

c94733d2   Renato De Donato   paper-card modify
36
              #paper_card_container .legend {

7383b38e   Luigi Serra   paper-card-contro...
37
                  position: relative;

c94733d2   Renato De Donato   paper-card modify
38
                  bottom: 48px;

89558a41   Renato De Donato   datatype, provide...
39
40
                  height: 16px;

                  padding: 16px 8px;

c94733d2   Renato De Donato   paper-card modify
41
                  background-color: rgba(0, 0, 0, 0.8);

eb240478   Luigi Serra   public room cards...
42
                  color: white;

b4190b56   Renato De Donato   myspace update
43
                  font-weight: 700;

89558a41   Renato De Donato   datatype, provide...
44
45
46
47
                  /*word-wrap: break-word;*/

                  overflow: hidden;

                  white-space: nowrap;

                  text-overflow: ellipsis;

eb240478   Luigi Serra   public room cards...
48
              }

eb240478   Luigi Serra   public room cards...
49
  

c94733d2   Renato De Donato   paper-card modify
50
51
52
              #paper_card_container .footer {

                  height: 64px;

                  width: 100%;

b4190b56   Renato De Donato   myspace update
53
                  position: relative;

c94733d2   Renato De Donato   paper-card modify
54
55
56
                  bottom: 48px;

                  padding: 4px;

                  font-size: 12px;

89558a41   Renato De Donato   datatype, provide...
57
                  /*word-wrap: break-word;*/

b4190b56   Renato De Donato   myspace update
58
                  overflow: hidden;

89558a41   Renato De Donato   datatype, provide...
59
60
                  white-space: nowrap;

                  text-overflow: ellipsis;

eb240478   Luigi Serra   public room cards...
61
              }

c76a9f85   Luigi Serra   card and controll...
62
  

b4190b56   Renato De Donato   myspace update
63
64
65
66
              paper-fab {

                  position: absolute;

                  z-index: 10;

                  --paper-fab-background:#2196F3;

eb240478   Luigi Serra   public room cards...
67
              }

7383b38e   Luigi Serra   paper-card-contro...
68
  

b4190b56   Renato De Donato   myspace update
69
              paper-fab.open {

89558a41   Renato De Donato   datatype, provide...
70
                  bottom: 40px;

b4190b56   Renato De Donato   myspace update
71
                  right: 8px;

7383b38e   Luigi Serra   paper-card-contro...
72
              }

36f13d09   Luigi Serra   selection control...
73
  

b4190b56   Renato De Donato   myspace update
74
              paper-fab.modify {

36f13d09   Luigi Serra   selection control...
75
                  top: -12px;

b4190b56   Renato De Donato   myspace update
76
                  right: 20px;

36f13d09   Luigi Serra   selection control...
77
78
79
80
                  --iron-icon-height: 18px;

                  --iron-icon-width: 18px;

                  width: 24px;

                  height: 24px;

b4190b56   Renato De Donato   myspace update
81
                  --paper-fab-background:#B6B6B6;

36f13d09   Luigi Serra   selection control...
82
              }

c76a9f85   Luigi Serra   card and controll...
83
  

b4190b56   Renato De Donato   myspace update
84
85
86
              paper-fab.delete {

                  top: -12px;

                  right: -12px;

c76a9f85   Luigi Serra   card and controll...
87
88
89
90
                  --iron-icon-height: 18px;

                  --iron-icon-width: 18px;

                  width: 24px;

                  height: 24px;

b4190b56   Renato De Donato   myspace update
91
                  --paper-fab-background:#B6B6B6;

c76a9f85   Luigi Serra   card and controll...
92
93
              }

  

b4190b56   Renato De Donato   myspace update
94
95
96
97
98
99
100
              paper-dialog {

                  margin: 0px;

                  padding: 0px;

              }

  

              #fullscreen_container {

                  display: inline;

c76a9f85   Luigi Serra   card and controll...
101
102
                  position: fixed;

                  width: 80%;

b4190b56   Renato De Donato   myspace update
103
                  height: 70vh;

c76a9f85   Luigi Serra   card and controll...
104
105
                  right: 0;

                  left: 0;

b4190b56   Renato De Donato   myspace update
106
                  top: 64px;

c76a9f85   Luigi Serra   card and controll...
107
108
                  margin-right: auto;

                  margin-left: auto;

35420b08   Luigi Serra   paper-card-contro...
109
                  z-index: 1100;

b4190b56   Renato De Donato   myspace update
110
111
                  padding: 8px;

                  background-color: white;

c76a9f85   Luigi Serra   card and controll...
112
113
              }

  

b4190b56   Renato De Donato   myspace update
114
115
              #fullscreen_content {

                  margin: 0px;

c76a9f85   Luigi Serra   card and controll...
116
              }

eb240478   Luigi Serra   public room cards...
117
118
119
          </style>

  

  

c94733d2   Renato De Donato   paper-card modify
120
          <paper-material id="paper_card_container" elevation="3">

eb240478   Luigi Serra   public room cards...
121
  

c844388d   Renato De Donato   paper-card ln, bu...
122
              <paper-fab id="card_modify" class="modify" mini icon="create" on-click="_handleModifyClick"></paper-fab>

eb240478   Luigi Serra   public room cards...
123
  

c844388d   Renato De Donato   paper-card ln, bu...
124
              <paper-fab id="card_delete" class="delete" mini icon="delete" on-click="_handleDeleteClick"></paper-fab>

c76a9f85   Luigi Serra   card and controll...
125
  

b4190b56   Renato De Donato   myspace update
126
127
128
              <div id="content">

                  <content></content>

              </div>

c76a9f85   Luigi Serra   card and controll...
129
  

89558a41   Renato De Donato   datatype, provide...
130
              <div class="legend" title="{{cardTitle}}">

b4190b56   Renato De Donato   myspace update
131
                  {{cardTitle}}

89558a41   Renato De Donato   datatype, provide...
132
              </div>

7383b38e   Luigi Serra   paper-card-contro...
133
  

89558a41   Renato De Donato   datatype, provide...
134
135
136
              <template is="dom-if" if="{{checkType(cardType, 'link')}}">

                  <paper-fab id="card_open_link" class="open" mini icon="link" on-click="_handleOpenClick"></paper-fab>

              </template>

7383b38e   Luigi Serra   paper-card-contro...
137
  

89558a41   Renato De Donato   datatype, provide...
138
139
140
              <template is="dom-if" if="{{checkType(cardType, 'text')}}">

                  <paper-fab id="card_open_text" class="open" mini icon="text-format" on-click="_handleOpenClick"></paper-fab>

              </template>

7383b38e   Luigi Serra   paper-card-contro...
141
  

89558a41   Renato De Donato   datatype, provide...
142
143
144
              <template is="dom-if" if="{{checkType(cardType, 'datalet')}}">

                  <paper-fab id="card_open_datalet" class="open" mini icon="assessment" on-click="_handleOpenClick"></paper-fab>

              </template>

7383b38e   Luigi Serra   paper-card-contro...
145
  

89558a41   Renato De Donato   datatype, provide...
146
              <div class="footer" title="{{comment}}">

c94733d2   Renato De Donato   paper-card modify
147
                  {{comment}}

b4190b56   Renato De Donato   myspace update
148
              </div>

eb240478   Luigi Serra   public room cards...
149
  

b4190b56   Renato De Donato   myspace update
150
151
152
153
              <paper-dialog id="fullscreen_container" entry-animation="scale-up-animation" exit-animation="fade-out-animation">

                  <!--with-backdrop-->

                  <div id="fullscreen_content"></div>

              </paper-dialog>

c76a9f85   Luigi Serra   card and controll...
154
  

1b49624d   isisadmin   paper-card-contro...
155
          </paper-material>

eb240478   Luigi Serra   public room cards...
156
  

1b49624d   isisadmin   paper-card-contro...
157
158
      </template>

  

eb240478   Luigi Serra   public room cards...
159
160
      <script src="../shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>

  

1b49624d   isisadmin   paper-card-contro...
161
162
      <script>

          Polymer({

eb240478   Luigi Serra   public room cards...
163
              is: "paper-card-controllet",

1b49624d   isisadmin   paper-card-contro...
164
              properties: {

b4190b56   Renato De Donato   myspace update
165
  

1b49624d   isisadmin   paper-card-contro...
166
167
                  width: {

                      type: Number,

c94733d2   Renato De Donato   paper-card modify
168
                      value: 200

1b49624d   isisadmin   paper-card-contro...
169
                  },

b4190b56   Renato De Donato   myspace update
170
  

eb240478   Luigi Serra   public room cards...
171
172
                  height: {

                      type: Number,

6f57fcdf   Renato De Donato   paper-card
173
                      value: 250

b4190b56   Renato De Donato   myspace update
174
175
                  },

  

4b412909   Luigi Serra   paper-card-contro...
176
                  cardType:{

eb240478   Luigi Serra   public room cards...
177
                      type: String,

c94733d2   Renato De Donato   paper-card modify
178
                      value: ""

6f8e74f7   Luigi Serra   card update
179
                  },

b4190b56   Renato De Donato   myspace update
180
  

0fc2aafe   Luigi Serra   updates
181
                  cardTitle:{

6f8e74f7   Luigi Serra   card update
182
                      type: String,

67b280f4   Luigi Serra   search feature
183
                      value: ""

b9dd9495   Luigi Serra   selection control...
184
                  },

b4190b56   Renato De Donato   myspace update
185
186
187
188
  

                  comment:{//cardDescription

                      cardType: String,

                      value: ""

6f8e74f7   Luigi Serra   card update
189
190
191
192
                  }

  

              },

  

c94733d2   Renato De Donato   paper-card modify
193
194
195
196
              ready: function(){

                  this._resize();

              },

  

e27db669   isisadmin   paper card contro...
197
              attached: function(){

c94733d2   Renato De Donato   paper-card modify
198
199
200
                  if(this.cardType == "text")

                      this.$.content.className += this.$.content.className ? ' text' : 'text';

  

b4190b56   Renato De Donato   myspace update
201
                  $(this.$.fullscreen_container).perfectScrollbar();

c844388d   Renato De Donato   paper-card ln, bu...
202
  

6f57fcdf   Renato De Donato   paper-card
203
                  this._resize();

c844388d   Renato De Donato   paper-card ln, bu...
204
205
206
207
                  this._translate();

              },

  

              _translate: function(){

2813afd7   Renato De Donato   locales ln mod
208
                  paper_ln["ln"] = ODE.user_language;

c844388d   Renato De Donato   paper-card ln, bu...
209
  

2813afd7   Renato De Donato   locales ln mod
210
211
                  this.$.card_modify.setAttribute("title", paper_ln["modify_"+paper_ln["ln"]]);

                  this.$.card_delete.setAttribute("title", paper_ln["delete_"+paper_ln["ln"]]);

c844388d   Renato De Donato   paper-card ln, bu...
212
                  if(this.checkType(this.cardType, 'link'))

fb05b400   Renato De Donato   controllet 2.0, n...
213
214
                      if(this.$$("#card_open_link"))

                          this.$$("#card_open_link").setAttribute("title", paper_ln["open_"+paper_ln["ln"]]);

c844388d   Renato De Donato   paper-card ln, bu...
215
                  if(this.checkType(this.cardType, 'text'))

fb05b400   Renato De Donato   controllet 2.0, n...
216
217
                      if(this.$$("#card_open_text"))

                          this.$$("#card_open_text").setAttribute("title", paper_ln["open_"+paper_ln["ln"]]);

c844388d   Renato De Donato   paper-card ln, bu...
218
                  if(this.checkType(this.cardType, 'datalet'))

fb05b400   Renato De Donato   controllet 2.0, n...
219
220
                      if(this.$$("#card_open_datalet"))

                          this.$$("#card_open_datalet").setAttribute("title", paper_ln["open_"+paper_ln["ln"]]);

1b49624d   isisadmin   paper-card-contro...
221
              },

eb240478   Luigi Serra   public room cards...
222
  

c94733d2   Renato De Donato   paper-card modify
223
224
225
              _resize: function(){

                  $(this.$.paper_card_container).height(this.height);

                  $(this.$.paper_card_container).width(this.width);

1b49624d   isisadmin   paper-card-contro...
226
              },

eb240478   Luigi Serra   public room cards...
227
228
229
  

              checkType: function(type, check){

                  return (type == check);

9d4a34db   Luigi Serra   selection control...
230
231
              },

  

b4190b56   Renato De Donato   myspace update
232
              _handleDeleteClick: function(){

c76a9f85   Luigi Serra   card and controll...
233
234
235
                  this.fire('paper-card-controllet_delete-clicked', {data : this});

              },

  

b4190b56   Renato De Donato   myspace update
236
237
238
              _handleModifyClick: function(){

                  this.fire('paper-card-controllet_details-clicked', {data : this});

              },

c76a9f85   Luigi Serra   card and controll...
239
  

b4190b56   Renato De Donato   myspace update
240
241
              _handleOpenClick: function(){

                  var html;

c76a9f85   Luigi Serra   card and controll...
242
243
                  switch(this.cardType){

                      case 'text':

b4190b56   Renato De Donato   myspace update
244
                          this.$.fullscreen_container.style.backgroundColor = "#ffc";

c76a9f85   Luigi Serra   card and controll...
245
246
                          break;

                      case 'link':

b4190b56   Renato De Donato   myspace update
247
                          window.open(this.getAttribute('card-link'), '_blank');

c76a9f85   Luigi Serra   card and controll...
248
249
250
                          return;

                  }

  

35420b08   Luigi Serra   paper-card-contro...
251
                  var html = this.$.content.innerHTML;

35420b08   Luigi Serra   paper-card-contro...
252
253
                  this.$.fullscreen_content.innerHTML = html;

  

b4190b56   Renato De Donato   myspace update
254
255
                  this.$.fullscreen_container.open();

                  this.$.fullscreen_container.style.display = "inline";//datalet resize in chrome

c76a9f85   Luigi Serra   card and controll...
256
              }

b4190b56   Renato De Donato   myspace update
257
  

1b49624d   isisadmin   paper-card-contro...
258
259
260
          })

      </script>

  

1b49624d   isisadmin   paper-card-contro...
261
  </dom-module>