Blame view

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

7c272bb3   Andrea Petta   plugin update
82
                  padding: 0px;

36f13d09   Luigi Serra   selection control...
83
              }

c76a9f85   Luigi Serra   card and controll...
84
  

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

                  top: -12px;

                  right: -12px;

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

                  --iron-icon-width: 18px;

                  width: 24px;

                  height: 24px;

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

7c272bb3   Andrea Petta   plugin update
93
                  padding: 0px;

c76a9f85   Luigi Serra   card and controll...
94
95
              }

  

b4190b56   Renato De Donato   myspace update
96
97
98
99
100
101
102
              paper-dialog {

                  margin: 0px;

                  padding: 0px;

              }

  

              #fullscreen_container {

                  display: inline;

c76a9f85   Luigi Serra   card and controll...
103
104
                  position: fixed;

                  width: 80%;

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

c76a9f85   Luigi Serra   card and controll...
106
107
                  right: 0;

                  left: 0;

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

c76a9f85   Luigi Serra   card and controll...
109
110
                  margin-right: auto;

                  margin-left: auto;

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

b4190b56   Renato De Donato   myspace update
112
113
                  padding: 8px;

                  background-color: white;

c76a9f85   Luigi Serra   card and controll...
114
115
              }

  

b4190b56   Renato De Donato   myspace update
116
117
              #fullscreen_content {

                  margin: 0px;

c76a9f85   Luigi Serra   card and controll...
118
              }

eb240478   Luigi Serra   public room cards...
119
120
121
          </style>

  

  

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

eb240478   Luigi Serra   public room cards...
123
  

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

eb240478   Luigi Serra   public room cards...
125
  

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

c76a9f85   Luigi Serra   card and controll...
127
  

b4190b56   Renato De Donato   myspace update
128
129
130
              <div id="content">

                  <content></content>

              </div>

c76a9f85   Luigi Serra   card and controll...
131
  

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

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

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

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

89558a41   Renato De Donato   datatype, provide...
136
137
138
              <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...
139
  

89558a41   Renato De Donato   datatype, provide...
140
141
142
              <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...
143
  

89558a41   Renato De Donato   datatype, provide...
144
145
146
              <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...
147
  

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

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

b4190b56   Renato De Donato   myspace update
150
              </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,

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

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

b4190b56   Renato De Donato   myspace update
172
  

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

                      type: Number,

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

b4190b56   Renato De Donato   myspace update
176
177
                  },

  

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

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

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

6f8e74f7   Luigi Serra   card update
181
                  },

b4190b56   Renato De Donato   myspace update
182
  

0fc2aafe   Luigi Serra   updates
183
                  cardTitle:{

6f8e74f7   Luigi Serra   card update
184
                      type: String,

67b280f4   Luigi Serra   search feature
185
                      value: ""

b9dd9495   Luigi Serra   selection control...
186
                  },

b4190b56   Renato De Donato   myspace update
187
188
189
190
  

                  comment:{//cardDescription

                      cardType: String,

                      value: ""

6f8e74f7   Luigi Serra   card update
191
192
193
194
                  }

  

              },

  

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

                  this._resize();

              },

  

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

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

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

  

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

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

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

c844388d   Renato De Donato   paper-card ln, bu...
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'))

fb05b400   Renato De Donato   controllet 2.0, n...
215
216
                      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...
217
                  if(this.checkType(this.cardType, 'text'))

fb05b400   Renato De Donato   controllet 2.0, n...
218
219
                      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...
220
                  if(this.checkType(this.cardType, 'datalet'))

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

                          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
  

c94733d2   Renato De Donato   paper-card modify
225
226
227
              _resize: function(){

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

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

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

eb240478   Luigi Serra   public room cards...
229
230
231
  

              checkType: function(type, check){

                  return (type == check);

9d4a34db   Luigi Serra   selection control...
232
233
              },

  

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

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

              },

  

b4190b56   Renato De Donato   myspace update
238
239
240
              _handleModifyClick: function(){

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

              },

c76a9f85   Luigi Serra   card and controll...
241
  

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

                  var html;

c76a9f85   Luigi Serra   card and controll...
244
245
                  switch(this.cardType){

                      case 'text':

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

c76a9f85   Luigi Serra   card and controll...
247
248
                          break;

                      case 'link':

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

c76a9f85   Luigi Serra   card and controll...
250
251
252
                          return;

                  }

  

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

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

  

b4190b56   Renato De Donato   myspace update
256
257
                  this.$.fullscreen_container.open();

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

c76a9f85   Luigi Serra   card and controll...
258
              }

b4190b56   Renato De Donato   myspace update
259
  

1b49624d   isisadmin   paper-card-contro...
260
261
262
          })

      </script>

  

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