Blame view

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

b4190b56   Renato De Donato   myspace update
39
40
                  height: 32px;

                  padding: 16px 0px 0px 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;

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

eb240478   Luigi Serra   public room cards...
45
              }

eb240478   Luigi Serra   public room cards...
46
  

c94733d2   Renato De Donato   paper-card modify
47
48
49
              #paper_card_container .footer {

                  height: 64px;

                  width: 100%;

b4190b56   Renato De Donato   myspace update
50
                  position: relative;

c94733d2   Renato De Donato   paper-card modify
51
52
53
                  bottom: 48px;

                  padding: 4px;

                  font-size: 12px;

b4190b56   Renato De Donato   myspace update
54
55
                  word-wrap: break-word;

                  overflow: hidden;

eb240478   Luigi Serra   public room cards...
56
              }

c76a9f85   Luigi Serra   card and controll...
57
  

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

                  position: absolute;

                  z-index: 10;

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

eb240478   Luigi Serra   public room cards...
62
              }

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

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

b4190b56   Renato De Donato   myspace update
65
66
                  bottom: -20px;

                  right: 8px;

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

36f13d09   Luigi Serra   selection control...
68
  

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

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

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

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

                  --iron-icon-width: 18px;

                  width: 24px;

                  height: 24px;

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

36f13d09   Luigi Serra   selection control...
77
              }

c76a9f85   Luigi Serra   card and controll...
78
  

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

                  top: -12px;

                  right: -12px;

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

                  --iron-icon-width: 18px;

                  width: 24px;

                  height: 24px;

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

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

  

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

                  margin: 0px;

                  padding: 0px;

              }

  

              #fullscreen_container {

                  display: inline;

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

                  width: 80%;

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

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

                  left: 0;

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

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

                  margin-left: auto;

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

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

                  background-color: white;

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

  

b4190b56   Renato De Donato   myspace update
109
110
              #fullscreen_content {

                  margin: 0px;

c76a9f85   Luigi Serra   card and controll...
111
              }

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

  

  

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

eb240478   Luigi Serra   public room cards...
116
  

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

eb240478   Luigi Serra   public room cards...
118
  

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

c76a9f85   Luigi Serra   card and controll...
120
  

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

                  <content></content>

              </div>

c76a9f85   Luigi Serra   card and controll...
124
  

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

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

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

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

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

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

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

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

b4190b56   Renato De Donato   myspace update
133
                  </template>

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

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

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

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

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

b4190b56   Renato De Donato   myspace update
139
                  </template>

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

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

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

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

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

b4190b56   Renato De Donato   myspace update
145
                  </template>

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

b4190b56   Renato De Donato   myspace update
147
              </div>

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

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

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

b4190b56   Renato De Donato   myspace update
151
              </div>

eb240478   Luigi Serra   public room cards...
152
  

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

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

eb240478   Luigi Serra   public room cards...
159
  

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

  

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

  

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

          Polymer({

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

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

b4190b56   Renato De Donato   myspace update
168
  

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

                      type: Number,

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

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

b4190b56   Renato De Donato   myspace update
173
  

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

                      type: Number,

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

b4190b56   Renato De Donato   myspace update
177
178
                  },

  

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

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

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

6f8e74f7   Luigi Serra   card update
182
                  },

b4190b56   Renato De Donato   myspace update
183
  

0fc2aafe   Luigi Serra   updates
184
                  cardTitle:{

6f8e74f7   Luigi Serra   card update
185
                      type: String,

67b280f4   Luigi Serra   search feature
186
                      value: ""

b9dd9495   Luigi Serra   selection control...
187
                  },

b4190b56   Renato De Donato   myspace update
188
189
190
191
  

                  comment:{//cardDescription

                      cardType: String,

                      value: ""

6f8e74f7   Luigi Serra   card update
192
193
194
195
                  }

  

              },

  

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

                  this._resize();

              },

  

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

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

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

  

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

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

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

c844388d   Renato De Donato   paper-card ln, bu...
207
208
209
210
                  this._translate();

              },

  

              _translate: function(){

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

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

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

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

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

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

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

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

eb240478   Luigi Serra   public room cards...
225
  

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

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

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

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

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

              checkType: function(type, check){

                  return (type == check);

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

  

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

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

              },

  

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

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

              },

c76a9f85   Luigi Serra   card and controll...
242
  

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

                  var html;

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

                      case 'text':

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

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

                      case 'link':

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

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

                  }

  

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

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

  

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

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

c76a9f85   Luigi Serra   card and controll...
259
              }

b4190b56   Renato De Donato   myspace update
260
  

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

      </script>

  

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