Blame view

controllets/paper-card-controllet/paper-card-controllet.html 8.85 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;

eb240478   Luigi Serra   public room cards...
20
                  background-color: white;

13c53ccd   Luigi Serra   cards updates
21
22
23
                  position: relative;

                  float: left;

                  margin: 40px;

eb240478   Luigi Serra   public room cards...
24
25
              }

  

b4190b56   Renato De Donato   myspace update
26
27
28
              #content {

                  padding: 4px 4px 0px 4px;

                  position:relative;

eb240478   Luigi Serra   public room cards...
29
              }

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

0fc2aafe   Luigi Serra   updates
31
              .legend {

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

b4190b56   Renato De Donato   myspace update
33
34
35
                  top: -48px;

                  height: 32px;

                  padding: 16px 0px 0px 8px;

13c53ccd   Luigi Serra   cards updates
36
                  /*z-index: 1000;*/

7383b38e   Luigi Serra   paper-card-contro...
37
                  background: rgba(0,0,0,0.8);

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

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

a1f9b957   Luigi Serra   create card updates
40
                  word-wrap: break-word;

eb240478   Luigi Serra   public room cards...
41
              }

eb240478   Luigi Serra   public room cards...
42
  

b4190b56   Renato De Donato   myspace update
43
44
              .footer {

                  height: 16px;

eb240478   Luigi Serra   public room cards...
45
              }

c76a9f85   Luigi Serra   card and controll...
46
  

b4190b56   Renato De Donato   myspace update
47
48
49
50
51
52
53
54
55
56
              .comment {

                  position: relative;

                  top: -50px;

                  height: 50px;

                  background-color: white;

                  padding: 8px;

                  font-size: small;

                  color: #727272;

                  word-wrap: break-word;

                  overflow: hidden;

eb240478   Luigi Serra   public room cards...
57
              }

c76a9f85   Luigi Serra   card and controll...
58
  

b4190b56   Renato De Donato   myspace update
59
60
61
62
              paper-fab {

                  position: absolute;

                  z-index: 10;

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

eb240478   Luigi Serra   public room cards...
63
              }

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

b4190b56   Renato De Donato   myspace update
65
66
67
68
              paper-fab.open {

                  /*bottom: 28px;*/

                  bottom: -20px;

                  right: 8px;

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

36f13d09   Luigi Serra   selection control...
70
  

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

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

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

36f13d09   Luigi Serra   selection control...
74
75
76
77
                  --iron-icon-height: 18px;

                  --iron-icon-width: 18px;

                  width: 24px;

                  height: 24px;

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

36f13d09   Luigi Serra   selection control...
79
              }

c76a9f85   Luigi Serra   card and controll...
80
  

b4190b56   Renato De Donato   myspace update
81
82
83
              paper-fab.delete {

                  top: -12px;

                  right: -12px;

c76a9f85   Luigi Serra   card and controll...
84
85
86
87
                  --iron-icon-height: 18px;

                  --iron-icon-width: 18px;

                  width: 24px;

                  height: 24px;

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

c76a9f85   Luigi Serra   card and controll...
89
90
              }

  

b4190b56   Renato De Donato   myspace update
91
92
93
94
95
96
97
              paper-dialog {

                  margin: 0px;

                  padding: 0px;

              }

  

              #fullscreen_container {

                  display: inline;

c76a9f85   Luigi Serra   card and controll...
98
99
                  position: fixed;

                  width: 80%;

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

c76a9f85   Luigi Serra   card and controll...
101
102
                  right: 0;

                  left: 0;

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

c76a9f85   Luigi Serra   card and controll...
104
105
                  margin-right: auto;

                  margin-left: auto;

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

b4190b56   Renato De Donato   myspace update
107
108
                  padding: 8px;

                  background-color: white;

c76a9f85   Luigi Serra   card and controll...
109
110
              }

  

b4190b56   Renato De Donato   myspace update
111
112
              #fullscreen_content {

                  margin: 0px;

c76a9f85   Luigi Serra   card and controll...
113
              }

eb240478   Luigi Serra   public room cards...
114
115
116
          </style>

  

  

b4190b56   Renato De Donato   myspace update
117
          <paper-material id="paper_card_container" elevation="{{elevation}}">

eb240478   Luigi Serra   public room cards...
118
  

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

eb240478   Luigi Serra   public room cards...
120
  

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

c76a9f85   Luigi Serra   card and controll...
122
  

b4190b56   Renato De Donato   myspace update
123
124
125
              <div id="content">

                  <content></content>

              </div>

c76a9f85   Luigi Serra   card and controll...
126
  

b4190b56   Renato De Donato   myspace update
127
              <div class="legend">

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

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

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

b4190b56   Renato De Donato   myspace update
131
                  <template is="dom-if" if="{{checkType(cardType, 'link')}}">

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

c844388d   Renato De Donato   paper-card ln, bu...
133
                      <paper-fab id="card_open_link" class="open" mini icon="link" on-click="_handleOpenClick"></paper-fab>

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

b4190b56   Renato De Donato   myspace update
135
                  </template>

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

b4190b56   Renato De Donato   myspace update
137
                  <template is="dom-if" if="{{checkType(cardType, 'text')}}">

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

c844388d   Renato De Donato   paper-card ln, bu...
139
                      <paper-fab id="card_open_text" class="open" mini icon="text-format" on-click="_handleOpenClick"></paper-fab>

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

b4190b56   Renato De Donato   myspace update
141
                  </template>

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

b4190b56   Renato De Donato   myspace update
143
                  <template is="dom-if" if="{{checkType(cardType, 'datalet')}}">

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

c844388d   Renato De Donato   paper-card ln, bu...
145
                      <paper-fab id="card_open_datalet" class="open" mini icon="assessment" on-click="_handleOpenClick"></paper-fab>

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

b4190b56   Renato De Donato   myspace update
147
                  </template>

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

b4190b56   Renato De Donato   myspace update
149
              </div>

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

b4190b56   Renato De Donato   myspace update
151
152
153
              <div class="footer">

                  <div class="comment">{{comment}}</div>

              </div>

eb240478   Luigi Serra   public room cards...
154
  

b4190b56   Renato De Donato   myspace update
155
156
157
158
              <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...
159
  

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

eb240478   Luigi Serra   public room cards...
161
  

1b49624d   isisadmin   paper-card-contro...
162
163
      </template>

  

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

  

1b49624d   isisadmin   paper-card-contro...
166
167
      <script>

          Polymer({

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

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

b4190b56   Renato De Donato   myspace update
170
  

1b49624d   isisadmin   paper-card-contro...
171
172
                  width: {

                      type: Number,

563db87f   isisadmin   bug fix
173
                      observer: "_changeWidth"

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

b4190b56   Renato De Donato   myspace update
175
  

eb240478   Luigi Serra   public room cards...
176
177
                  height: {

                      type: Number,

563db87f   isisadmin   bug fix
178
                      observer: "_changeHeight"

eb240478   Luigi Serra   public room cards...
179
                  },

b4190b56   Renato De Donato   myspace update
180
181
182
183
184
185
  

                  elevation:{

                      type: Number,

                      value: 3

                  },

  

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

eb240478   Luigi Serra   public room cards...
187
188
                      type: String,

                      value: "text"

6f8e74f7   Luigi Serra   card update
189
                  },

b4190b56   Renato De Donato   myspace update
190
  

0fc2aafe   Luigi Serra   updates
191
                  cardTitle:{

6f8e74f7   Luigi Serra   card update
192
                      type: String,

67b280f4   Luigi Serra   search feature
193
                      value: ""

b9dd9495   Luigi Serra   selection control...
194
                  },

b4190b56   Renato De Donato   myspace update
195
196
197
198
  

                  comment:{//cardDescription

                      cardType: String,

                      value: ""

6f8e74f7   Luigi Serra   card update
199
200
201
202
                  }

  

              },

  

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

4b412909   Luigi Serra   paper-card-contro...
204
                  if(this.cardType == "text"){

b4190b56   Renato De Donato   myspace update
205
                      this.$.content.style.backgroundColor = "#FFFFCC";

eb240478   Luigi Serra   public room cards...
206
                  }

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

c844388d   Renato De Donato   paper-card ln, bu...
208
209
210
211
212
  

                  this._translate();

              },

  

              _translate: function(){

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

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

2813afd7   Renato De Donato   locales ln mod
215
216
                  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...
217
                  if(this.checkType(this.cardType, 'link'))

2813afd7   Renato De Donato   locales ln mod
218
                      this.$$("#card_open_link").setAttribute("title", paper_ln["open_"+paper_ln["ln"]]);

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

2813afd7   Renato De Donato   locales ln mod
220
                      this.$$("#card_open_text").setAttribute("title", paper_ln["open_"+paper_ln["ln"]]);

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

2813afd7   Renato De Donato   locales ln mod
222
                      this.$$("#card_open_datalet").setAttribute("title", paper_ln["open_"+paper_ln["ln"]]);

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

eb240478   Luigi Serra   public room cards...
224
  

b4190b56   Renato De Donato   myspace update
225
226
227
              _changeWidth: function(){

                  this.style.width = this.width + "px";

                  this.$.content.style.width = this.width - 8 + "px";

13c53ccd   Luigi Serra   cards updates
228
                  this.$.paper_card_container.style.width = this.width + "px";

eb240478   Luigi Serra   public room cards...
229
230
              },

  

b4190b56   Renato De Donato   myspace update
231
232
233
              _changeHeight: function(){

                  this.style.height = this.height + 64 + "px";

                  this.$.content.style.height = this.height - 4 + "px";

13c53ccd   Luigi Serra   cards updates
234
                  this.$.paper_card_container.style.height = this.height + "px";

6f8e74f7   Luigi Serra   card update
235
                  $(this.$.content).perfectScrollbar();

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

eb240478   Luigi Serra   public room cards...
237
238
239
  

              checkType: function(type, check){

                  return (type == check);

9d4a34db   Luigi Serra   selection control...
240
241
              },

  

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

c76a9f85   Luigi Serra   card and controll...
243
244
245
                  this.fire('paper-card-controllet_delete-clicked', {data : this});

              },

  

b4190b56   Renato De Donato   myspace update
246
247
248
              _handleModifyClick: function(){

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

              },

c76a9f85   Luigi Serra   card and controll...
249
  

b4190b56   Renato De Donato   myspace update
250
251
              _handleOpenClick: function(){

                  var html;

c76a9f85   Luigi Serra   card and controll...
252
253
                  switch(this.cardType){

                      case 'text':

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

c76a9f85   Luigi Serra   card and controll...
255
256
                          break;

                      case 'link':

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

c76a9f85   Luigi Serra   card and controll...
258
259
260
                          return;

                  }

  

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

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

  

b4190b56   Renato De Donato   myspace update
264
265
                  this.$.fullscreen_container.open();

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

c76a9f85   Luigi Serra   card and controll...
266
              }

b4190b56   Renato De Donato   myspace update
267
  

1b49624d   isisadmin   paper-card-contro...
268
269
270
          })

      </script>

  

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