28265108
Renato De Donato
new link-text con...
|
1
2
|
<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'>
|
bf28e75e
Luigi Serra
selection control...
|
3
|
|
28265108
Renato De Donato
new link-text con...
|
4
5
6
7
8
9
10
11
12
13
14
15
|
<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-input/paper-input.html">
<link rel="import" href="../../bower_components/paper-input/paper-textarea.html">
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
<!--per la lingua inportare nell' HEADER-->
<!--<link rel="localization" href="locales/{ln}.l20n">-->
<!--<script defer src="/dist/compat/web/l20n.js"></script>-->
<!--<card_Info "BASE INFO">-->
<!--<card_Text "TEXT">-->
<!--<card_Link "LINK">-->
|
c52e0307
Andrea Petta
refactoring
|
16
|
<!--<card_Preview "PREVIEW"> -->
|
49cc918f
Luigi Serra
selection control...
|
17
|
|
bf28e75e
Luigi Serra
selection control...
|
18
19
20
|
<dom-module id="create-card-controllet">
<template>
|
28265108
Renato De Donato
new link-text con...
|
21
22
23
24
25
|
<style is="custom-style">
#create_card_container {
display: flex;
height: 100%;
|
49cc918f
Luigi Serra
selection control...
|
26
|
width: 100%;
|
bf28e75e
Luigi Serra
selection control...
|
27
|
|
28265108
Renato De Donato
new link-text con...
|
28
29
|
font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 16px;
|
bf28e75e
Luigi Serra
selection control...
|
30
31
|
}
|
28265108
Renato De Donato
new link-text con...
|
32
33
34
35
|
#create_card_info {
height: calc(100% - 16px);
width: 50%;
margin: 8px 16px 8px 8px;
|
bf28e75e
Luigi Serra
selection control...
|
36
37
|
}
|
28265108
Renato De Donato
new link-text con...
|
38
39
40
41
|
#create_card_content {
height: calc(100% - 16px);
width: 50%;
margin: 8px 8px 8px 16px;
|
bf28e75e
Luigi Serra
selection control...
|
42
43
|
}
|
28265108
Renato De Donato
new link-text con...
|
44
45
46
47
|
.input_header {
height: 32px;
padding-top: 16px;
background-color: #B6B6B6;
|
bf28e75e
Luigi Serra
selection control...
|
48
|
text-align: center;
|
28265108
Renato De Donato
new link-text con...
|
49
|
font-weight: 700;
|
bf28e75e
Luigi Serra
selection control...
|
50
51
|
}
|
28265108
Renato De Donato
new link-text con...
|
52
|
p {
|
b4190b56
Renato De Donato
myspace update
|
53
54
55
56
57
58
59
60
|
padding: 16px 0px 0px 8px;
margin: 0px;
}
#create_card_text {
width: 100%;
height: 100%;
background-color: #FFFFCC;
|
bf28e75e
Luigi Serra
selection control...
|
61
62
|
}
|
28265108
Renato De Donato
new link-text con...
|
63
|
#create_card_title {
|
bf28e75e
Luigi Serra
selection control...
|
64
|
font-weight: bold;
|
28265108
Renato De Donato
new link-text con...
|
65
66
|
color: #2196F3;
text-align: center;
|
bf28e75e
Luigi Serra
selection control...
|
67
68
|
}
|
28265108
Renato De Donato
new link-text con...
|
69
70
71
|
#create_card_description {
font-style: italic;
color: #727272;
|
bf28e75e
Luigi Serra
selection control...
|
72
73
|
}
|
28265108
Renato De Donato
new link-text con...
|
74
75
76
77
78
|
paper-input, paper-textarea {
height: 48px;
width: calc(100% - 16px);
margin: 0px 0px 8px 8px;
--paper-input-container-focus-color: #2196F3;
|
49cc918f
Luigi Serra
selection control...
|
79
|
}
|
bf28e75e
Luigi Serra
selection control...
|
80
|
|
28265108
Renato De Donato
new link-text con...
|
81
82
83
84
85
86
87
88
89
90
91
|
paper-button {
position: absolute;
bottom: 16px;
right: 11px;
height: 48px;
width: 172px;
background-color: #00BCD4;
color: white;
font-weight: 700;
padding: 16px;
|
7c6897cd
Luigi Serra
controllets and b...
|
92
93
|
}
|
28265108
Renato De Donato
new link-text con...
|
94
95
96
97
98
99
|
paper-button:hover {
background-color: #00AABF;
box-shadow: 0px 8px 12px #888;
-webkit-box-shadow: 0px 8px 12px #888;
-moz-box-shadow: 0px 8px 12px #888;
|
7c6897cd
Luigi Serra
controllets and b...
|
100
101
|
}
|
28265108
Renato De Donato
new link-text con...
|
102
103
|
paper-button[disabled] {
background-color: #B6B6B6;
|
c76a9f85
Luigi Serra
card and controll...
|
104
|
}
|
28265108
Renato De Donato
new link-text con...
|
105
|
</style>
|
c76a9f85
Luigi Serra
card and controll...
|
106
|
|
28265108
Renato De Donato
new link-text con...
|
107
|
<div id="create_card_container">
|
bf28e75e
Luigi Serra
selection control...
|
108
|
|
28265108
Renato De Donato
new link-text con...
|
109
110
|
<paper-material id="create_card_info" elevation="5">
<div class="input_header">BASE INFO</div>
|
bf28e75e
Luigi Serra
selection control...
|
111
|
|
efa1bdf3
Andrea Petta
refactoring
|
112
|
<paper-input value="{{cardTitle}}" maxlength="32" label="title"></paper-input>
|
bf28e75e
Luigi Serra
selection control...
|
113
|
|
28265108
Renato De Donato
new link-text con...
|
114
115
116
|
<paper-input value="{{description}}" maxlength="100" label="description"></paper-input>
<template is="dom-if" if="{{_checkType(type, 'link')}}">
|
bf28e75e
Luigi Serra
selection control...
|
117
|
|
28265108
Renato De Donato
new link-text con...
|
118
|
<div class="input_header" style="margin-top: 16px;">LINK</div>
|
bf28e75e
Luigi Serra
selection control...
|
119
|
|
28265108
Renato De Donato
new link-text con...
|
120
121
122
123
|
<paper-input
id="create_card_link"
value="{{link}}"
label="link"
|
28265108
Renato De Donato
new link-text con...
|
124
125
126
127
|
error-message="Invalid link">
</paper-input>
</template>
|
bf28e75e
Luigi Serra
selection control...
|
128
|
|
28265108
Renato De Donato
new link-text con...
|
129
|
<template is="dom-if" if="{{_checkType(type, 'text')}}">
|
bf28e75e
Luigi Serra
selection control...
|
130
|
|
28265108
Renato De Donato
new link-text con...
|
131
|
<div class="input_header" style="margin-top: 16px;">TEXT</div>
|
49cc918f
Luigi Serra
selection control...
|
132
|
|
28265108
Renato De Donato
new link-text con...
|
133
|
<paper-textarea value="{{text}}" label="text"></paper-textarea>
|
49cc918f
Luigi Serra
selection control...
|
134
135
|
</template>
|
bf28e75e
Luigi Serra
selection control...
|
136
|
|
28265108
Renato De Donato
new link-text con...
|
137
138
|
<paper-button id="add_button" raised on-click="_addCard">SAVE</paper-button>
</paper-material>
|
bf28e75e
Luigi Serra
selection control...
|
139
|
|
28265108
Renato De Donato
new link-text con...
|
140
|
<paper-material id="create_card_content" elevation="5">
|
b4190b56
Renato De Donato
myspace update
|
141
|
|
28265108
Renato De Donato
new link-text con...
|
142
|
<div class="input_header">PREVIEW</div>
|
49cc918f
Luigi Serra
selection control...
|
143
|
|
28265108
Renato De Donato
new link-text con...
|
144
|
<template is="dom-if" if="{{_checkType(type, 'link')}}">
|
49cc918f
Luigi Serra
selection control...
|
145
|
|
28265108
Renato De Donato
new link-text con...
|
146
|
<iframe id="create_card_iframe"></iframe>
|
49cc918f
Luigi Serra
selection control...
|
147
|
|
28265108
Renato De Donato
new link-text con...
|
148
149
150
|
</template>
<template is="dom-if" if="{{_checkType(type, 'text')}}">
|
49cc918f
Luigi Serra
selection control...
|
151
|
|
b4190b56
Renato De Donato
myspace update
|
152
153
154
155
156
|
<div id="create_card_text">
<p id ="create_card_title">{{cardTitle}}</p>
<p id ="create_card_description">{{description}}</p>
<p>{{text}}</p>
</div>
|
49cc918f
Luigi Serra
selection control...
|
157
|
|
28265108
Renato De Donato
new link-text con...
|
158
|
</template>
|
49cc918f
Luigi Serra
selection control...
|
159
|
|
28265108
Renato De Donato
new link-text con...
|
160
|
</paper-material>
|
bf28e75e
Luigi Serra
selection control...
|
161
162
163
164
165
|
</div>
</template>
|
bf28e75e
Luigi Serra
selection control...
|
166
167
168
169
170
171
|
<script>
Polymer({
is: "create-card-controllet",
properties: {
type:{
type: String,
|
28265108
Renato De Donato
new link-text con...
|
172
|
value: undefined//text or link
|
49cc918f
Luigi Serra
selection control...
|
173
174
|
},
|
efa1bdf3
Andrea Petta
refactoring
|
175
|
cardTitle:{
|
49cc918f
Luigi Serra
selection control...
|
176
|
type: String,
|
28265108
Renato De Donato
new link-text con...
|
177
|
value: ""
|
037d8ec8
Luigi Serra
selection control...
|
178
|
},
|
28265108
Renato De Donato
new link-text con...
|
179
180
|
description:{//comment
|
49cc918f
Luigi Serra
selection control...
|
181
|
type: String,
|
28265108
Renato De Donato
new link-text con...
|
182
|
value: ""
|
49cc918f
Luigi Serra
selection control...
|
183
|
},
|
28265108
Renato De Donato
new link-text con...
|
184
185
|
text:{
|
49cc918f
Luigi Serra
selection control...
|
186
|
type: String,
|
28265108
Renato De Donato
new link-text con...
|
187
|
value: ""
|
037d8ec8
Luigi Serra
selection control...
|
188
189
|
},
|
28265108
Renato De Donato
new link-text con...
|
190
191
192
193
|
link:{
type: String,
value: "",
observer : '_load'
|
bf28e75e
Luigi Serra
selection control...
|
194
|
}
|
28265108
Renato De Donato
new link-text con...
|
195
|
|
bf28e75e
Luigi Serra
selection control...
|
196
197
|
},
|
28265108
Renato De Donato
new link-text con...
|
198
199
200
|
ready : function() {
$(this.$.create_card_info).perfectScrollbar();
$(this.$.create_card_content).perfectScrollbar();
|
172c4387
Luigi Serra
controllets and b...
|
201
|
|
28265108
Renato De Donato
new link-text con...
|
202
203
|
var that = this;
window.addEventListener("resize", function() { that._resize(); });
|
bf28e75e
Luigi Serra
selection control...
|
204
205
|
},
|
28265108
Renato De Donato
new link-text con...
|
206
207
|
attached : function() {
this.async(function(){this._load();},100);
|
bf28e75e
Luigi Serra
selection control...
|
208
209
|
},
|
28265108
Renato De Donato
new link-text con...
|
210
211
212
213
214
215
216
217
218
219
|
_load : function() {
var link = this.$$("#create_card_link");
var iframe = this.$$("#create_card_iframe");
if(link){
var value = link.value;
if (value.indexOf("http") != 0)
value = "http://" + value;
|
fcb8da99
isisadmin
bug fix
|
220
|
if(/*!link.invalid &&*/ value.length > 16) {
|
28265108
Renato De Donato
new link-text con...
|
221
|
iframe.setAttribute("src", value);
|
b4190b56
Renato De Donato
myspace update
|
222
|
this.link = value;
|
28265108
Renato De Donato
new link-text con...
|
223
224
225
|
this._resize();
}
}
|
037d8ec8
Luigi Serra
selection control...
|
226
227
|
},
|
28265108
Renato De Donato
new link-text con...
|
228
229
230
|
_checkType: function(type, check){
return (type == check);
},
|
037d8ec8
Luigi Serra
selection control...
|
231
|
|
28265108
Renato De Donato
new link-text con...
|
232
|
_addCard: function(){
|
efa1bdf3
Andrea Petta
refactoring
|
233
|
this.fire('create-card-controllet_data', {data : this});
|
28265108
Renato De Donato
new link-text con...
|
234
|
},
|
037d8ec8
Luigi Serra
selection control...
|
235
|
|
28265108
Renato De Donato
new link-text con...
|
236
237
238
|
_resize : function(){
var h = $("#create_card_info").height() -64;
$("#create_card_iframe").height(h);
|
bf28e75e
Luigi Serra
selection control...
|
239
|
}
|
28265108
Renato De Donato
new link-text con...
|
240
|
|
bf28e75e
Luigi Serra
selection control...
|
241
242
243
244
|
})
</script>
</dom-module>
|