Blame view

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

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

  

b4190b56   Renato De Donato   myspace update
23
24
25
              #content {

                  padding: 4px 4px 0px 4px;

                  position:relative;

eb240478   Luigi Serra   public room cards...
26
              }

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

0fc2aafe   Luigi Serra   updates
28
              .legend {

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

b4190b56   Renato De Donato   myspace update
30
31
32
33
                  top: -48px;

                  height: 32px;

                  padding: 16px 0px 0px 8px;

                  z-index: 1000;

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

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

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

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

eb240478   Luigi Serra   public room cards...
38
              }

eb240478   Luigi Serra   public room cards...
39
  

b4190b56   Renato De Donato   myspace update
40
41
              .footer {

                  height: 16px;

eb240478   Luigi Serra   public room cards...
42
              }

c76a9f85   Luigi Serra   card and controll...
43
  

b4190b56   Renato De Donato   myspace update
44
45
46
47
48
49
50
51
52
53
              .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...
54
              }

c76a9f85   Luigi Serra   card and controll...
55
  

b4190b56   Renato De Donato   myspace update
56
57
58
59
              paper-fab {

                  position: absolute;

                  z-index: 10;

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

eb240478   Luigi Serra   public room cards...
60
              }

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

b4190b56   Renato De Donato   myspace update
62
63
64
65
              paper-fab.open {

                  /*bottom: 28px;*/

                  bottom: -20px;

                  right: 8px;

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

36f13d09   Luigi Serra   selection control...
67
  

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

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

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

36f13d09   Luigi Serra   selection control...
71
72
73
74
                  --iron-icon-height: 18px;

                  --iron-icon-width: 18px;

                  width: 24px;

                  height: 24px;

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

36f13d09   Luigi Serra   selection control...
76
              }

c76a9f85   Luigi Serra   card and controll...
77
  

b4190b56   Renato De Donato   myspace update
78
79
80
              paper-fab.delete {

                  top: -12px;

                  right: -12px;

c76a9f85   Luigi Serra   card and controll...
81
82
83
84
                  --iron-icon-height: 18px;

                  --iron-icon-width: 18px;

                  width: 24px;

                  height: 24px;

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

c76a9f85   Luigi Serra   card and controll...
86
87
              }

  

b4190b56   Renato De Donato   myspace update
88
89
90
91
92
93
94
              paper-dialog {

                  margin: 0px;

                  padding: 0px;

              }

  

              #fullscreen_container {

                  display: inline;

c76a9f85   Luigi Serra   card and controll...
95
96
                  position: fixed;

                  width: 80%;

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

c76a9f85   Luigi Serra   card and controll...
98
99
                  right: 0;

                  left: 0;

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

c76a9f85   Luigi Serra   card and controll...
101
102
                  margin-right: auto;

                  margin-left: auto;

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

b4190b56   Renato De Donato   myspace update
104
105
                  padding: 8px;

                  background-color: white;

c76a9f85   Luigi Serra   card and controll...
106
107
              }

  

b4190b56   Renato De Donato   myspace update
108
109
              #fullscreen_content {

                  margin: 0px;

c76a9f85   Luigi Serra   card and controll...
110
              }

eb240478   Luigi Serra   public room cards...
111
112
113
          </style>

  

  

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

eb240478   Luigi Serra   public room cards...
115
  

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

eb240478   Luigi Serra   public room cards...
117
  

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

c76a9f85   Luigi Serra   card and controll...
119
  

b4190b56   Renato De Donato   myspace update
120
121
122
              <div id="content">

                  <content></content>

              </div>

c76a9f85   Luigi Serra   card and controll...
123
  

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

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

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

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

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

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

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

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

b4190b56   Renato De Donato   myspace update
132
                  </template>

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

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

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

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

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

b4190b56   Renato De Donato   myspace update
138
                  </template>

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

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

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

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

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

b4190b56   Renato De Donato   myspace update
144
                  </template>

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

b4190b56   Renato De Donato   myspace update
146
              </div>

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

b4190b56   Renato De Donato   myspace update
148
149
150
              <div class="footer">

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

              </div>

eb240478   Luigi Serra   public room cards...
151
  

b4190b56   Renato De Donato   myspace update
152
153
154
155
              <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...
156
  

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

eb240478   Luigi Serra   public room cards...
158
  

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

  

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

  

1b49624d   isisadmin   paper-card-contro...
163
164
      <script>

          Polymer({

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

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

b4190b56   Renato De Donato   myspace update
167
  

1b49624d   isisadmin   paper-card-contro...
168
169
                  width: {

                      type: Number,

563db87f   isisadmin   bug fix
170
                      observer: "_changeWidth"

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

b4190b56   Renato De Donato   myspace update
172
  

eb240478   Luigi Serra   public room cards...
173
174
                  height: {

                      type: Number,

563db87f   isisadmin   bug fix
175
                      observer: "_changeHeight"

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

b4190b56   Renato De Donato   myspace update
177
178
179
180
181
182
  

                  elevation:{

                      type: Number,

                      value: 3

                  },

  

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

eb240478   Luigi Serra   public room cards...
184
185
                      type: String,

                      value: "text"

6f8e74f7   Luigi Serra   card update
186
                  },

b4190b56   Renato De Donato   myspace update
187
  

0fc2aafe   Luigi Serra   updates
188
                  cardTitle:{

6f8e74f7   Luigi Serra   card update
189
                      type: String,

67b280f4   Luigi Serra   search feature
190
                      value: ""

b9dd9495   Luigi Serra   selection control...
191
                  },

b4190b56   Renato De Donato   myspace update
192
193
194
195
  

                  comment:{//cardDescription

                      cardType: String,

                      value: ""

6f8e74f7   Luigi Serra   card update
196
197
198
199
                  }

  

              },

  

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

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

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

eb240478   Luigi Serra   public room cards...
203
                  }

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

c844388d   Renato De Donato   paper-card ln, bu...
205
206
207
208
209
  

                  this._translate();

              },

  

              _translate: function(){

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

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

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

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

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

2813afd7   Renato De Donato   locales ln mod
217
                      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'))

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

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

eb240478   Luigi Serra   public room cards...
221
  

b4190b56   Renato De Donato   myspace update
222
223
224
              _changeWidth: function(){

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

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

eb240478   Luigi Serra   public room cards...
225
226
              },

  

b4190b56   Renato De Donato   myspace update
227
228
229
              _changeHeight: function(){

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

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

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

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

eb240478   Luigi Serra   public room cards...
232
233
234
  

              checkType: function(type, check){

                  return (type == check);

9d4a34db   Luigi Serra   selection control...
235
236
              },

  

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

c76a9f85   Luigi Serra   card and controll...
238
239
240
                  this.fire('paper-card-controllet_delete-clicked', {data : this});

              },

  

b4190b56   Renato De Donato   myspace update
241
242
243
              _handleModifyClick: function(){

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

              },

c76a9f85   Luigi Serra   card and controll...
244
  

b4190b56   Renato De Donato   myspace update
245
246
              _handleOpenClick: function(){

                  var html;

c76a9f85   Luigi Serra   card and controll...
247
248
                  switch(this.cardType){

                      case 'text':

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

c76a9f85   Luigi Serra   card and controll...
250
251
                          break;

                      case 'link':

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

c76a9f85   Luigi Serra   card and controll...
253
254
255
                          return;

                  }

  

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

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

  

b4190b56   Renato De Donato   myspace update
259
260
                  this.$.fullscreen_container.open();

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

c76a9f85   Luigi Serra   card and controll...
261
              }

b4190b56   Renato De Donato   myspace update
262
  

1b49624d   isisadmin   paper-card-contro...
263
264
265
          })

      </script>

  

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