Blame view

controllets/document-card-controllet/document-card-controllet.html 6.56 KB
478a3abe   Luigi Serra   document card for...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
  <link rel="import" href="../../bower_components/polymer/polymer.html"/>
  <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"/>
  <link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html"/>
  <link rel="import" href="../../bower_components/neon-animation/neon-animation.html"/>
  
  <script src="../../locales/paper_card_controllet_ln.js"></script>
  
  <dom-module id="document-card-controllet">
  
      <template>
          <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>
  
              #paper_card_container {
                  font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
                  font-size: 16px;
                  background-color: white;
              }
  
              #content {
                  padding: 4px 4px 0px 4px;
                  position:relative;
                  width: 98%;
                  height: 90%;
              }
  
              .footer {
                  height: 16px;
              }
  
              .comment {
                  position: relative;
                  top: -50px;
                  height: 50px;
                  background-color: white;
                  padding: 8px;
                  font-size: small;
                  color: #727272;
                  word-wrap: break-word;
                  overflow: hidden;
              }
  
              paper-fab#fullscreen-button {
                  position: absolute;
                  /*z-index: 10;*/
                  top: 11px;
                  right: 15px;
                  --paper-fab-background:#FFFFFF;
                  padding : 0px;
                  margin: 0px;
                  height: 24px;
                  width: 24px;
                  color: #666666;
              }
  
              paper-dialog {
                  margin: 0px;
                  padding: 0px;
                  z-index: 1100;
              }
  
              #fullscreen_container {
                  display: inline;
                  position: fixed;
                  width: 90%;
                  height: 80vh;
                  right: 0;
                  left: 0;
                  top: 64px;
                  margin-right: auto;
                  margin-left: auto;
                  padding: 8px;
                  background-color: white;
              }
  
              #fullscreen_content {
                  margin: 0px;
              }
  
              #resource{
                  height: 100%;
                  width: 100%;
              }
  
              :host #docs-header{
                  display : none;
              }
  
26e25aec   Luigi Serra   documenent card u...
92
93
              #info_close_button{
                  z-index: 1;
8ab37b62   Luigi Serra   document card upd...
94
                  color: #666666;
26e25aec   Luigi Serra   documenent card u...
95
96
97
98
99
100
                  box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
                  -webkit-transition: 0.2s ease-out;
                  -moz-transition: 0.2s ease-out;
                  -o-transition: 0.2s ease-out;
                  transition: 0.2s ease-out;
                  cursor: pointer;
8ab37b62   Luigi Serra   document card upd...
101
                  background: linear-gradient(#f4f4f4,#e4e4e4);
26e25aec   Luigi Serra   documenent card u...
102
                  float: right;
8ab37b62   Luigi Serra   document card upd...
103
104
                  top: 11px;
                  right: 8px;
26e25aec   Luigi Serra   documenent card u...
105
106
                  margin: 0px;
                  position: absolute;
8ab37b62   Luigi Serra   document card upd...
107
108
109
                  height: 29px;
                  min-width: 30px;
                  padding: 5px;
26e25aec   Luigi Serra   documenent card u...
110
111
              }
  
478a3abe   Luigi Serra   document card for...
112
113
114
115
116
117
          </style>
  
  
          <paper-material id="paper_card_container" elevation="{{elevation}}">
  
              <div id="content">
26e25aec   Luigi Serra   documenent card u...
118
                  <iframe id="resource" src="{{resourceUrl}}?userName={{userName}}"></iframe>
478a3abe   Luigi Serra   document card for...
119
120
121
122
123
124
125
126
                  <!--<iframe id="resource" src="{{resourceUrl}}"></iframe>-->
              </div>
  
              <paper-fab id="fullscreen-button" class="open" mini icon="fullscreen" on-click="_handleOpenClick"></paper-fab>
  
              <paper-dialog id="fullscreen_container" entry-animation="scale-up-animation" exit-animation="fade-out-animation">
                  <!--with-backdrop-->
                  <div id="fullscreen_content"></div>
26e25aec   Luigi Serra   documenent card u...
127
                  <paper-button id="info_close_button" dialog-confirm autofocus>x</paper-button>
478a3abe   Luigi Serra   document card for...
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
              </paper-dialog>
  
          </paper-material>
  
      </template>
  
      <script src="../shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>
  
      <script>
          _this = null;
  
          Polymer({
              is: "document-card-controllet",
              properties: {
  
                  width: {
                      type: Number,
                      observer: "_changeWidth"
                  },
  
                  height: {
                      type: Number,
                      observer: "_changeHeight"
                  },
  
                  elevation:{
                      type: Number,
                      value: 3
                  },
  
                  createNewType : {
                      type : String,
                      value : undefined
                  },
  
                  comment:{
                      cardType: String,
                      value: ""
                  },
  
                  resourceUrl : {
                      type : String,
                      value : undefined
                  },
  
                  userName: {
                      type: String,
                      value: undefined
                  },
                  lang:{
                      type: String,
                      value: navigator.language
                  }
              },
  
              ready : function(){
              },
  
              attached: function(){
                  $(this.$.fullscreen_container).perfectScrollbar();
              },
  
  
              _changeWidth: function(){
                  //this.style.width = this.width + "px";
                  //this.$.paper_card_container.style.width = this.width + "px";
                  //this.$.content.style.width = this.width - 8 + "px";
              },
  
              _changeHeight: function(){
                  this.style.height = this.height +  "vh";
                  //this.$.content.width = this.width  - 4 + "vh";
                  this.$.paper_card_container.style.height = this.height + "vh";
                  this.$.content.style.height = this.height - 1 + "vh";
                  $(this.$.content).perfectScrollbar();
              },
  
              _handleOpenClick: function(){
                  this.$.fullscreen_content.style.height = "80vh";
                  this.$.fullscreen_content.innerHTML = this.$.content.innerHTML;
                  this.$.fullscreen_container.style.display = "inline";//datalet res
                  this.$.fullscreen_container.open();
              }
  
          })
      </script>
  
  </dom-module>