Здоровый образ жизни
Материал опубликован:
Обновлён:
The following has evaluated to null or missing: ==> ddmFormFieldValuesMap['title'] [in template "35723#35751#40245" at line 128, column 39] ---- Tip: It's the final [] step that caused this error, not those before it. ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign videoTitle = ddmFormFieldValu... [in template "35723#35751#40245" at line 128, column 17] ----
1<#assign jsonFactoryUtil = staticUtil["com.liferay.portal.kernel.json.JSONFactoryUtil"]>
2<#if entries?has_content>
3 <style>
4 .video {
5 position: relative;
6 }
7
8 .video__link {
9 display: block;
10 margin: 0;
11 padding: 0;
12 height: 100%;
13 }
14
15 .video__media {
16 border: 0;
17 width: 100%;
18 height: 100%;
19 min-height: 200px;
20 }
21
22 .video__button {
23 position: absolute;
24 top: 50%;
25 left: 50%;
26 z-index: 1;
27 display: none;
28 padding: 0;
29 border: none;
30 background-color: transparent;
31 transform: translate(-50%, -50%);
32 cursor: pointer
33 }
34
35 .video_rutube .video__button {
36 background: rgba(21, 23, 25, 0.4);
37 width: 48px;
38 height: 48px;
39 }
40 .video_youtube .video__button {
41 width: 68px;
42 height: 48px;
43 }
44 .video_rutube .video__button:focus,
45 .video.video_rutube:hover .video__button
46 {
47 background: rgba(21, 23, 25, 0.7);
48 }
49
50 .video_youtube .video__button-shape {
51 fill: #212121;
52 fill-opacity: 0.8;
53 }
54
55 .video_youtube .video__button-icon {
56 fill: #ffffff;
57 }
58
59 .video_youtube .video__button:focus {
60 outline: none;
61 }
62
63 .video.video_youtube:hover .video__button-shape,
64 .video_youtube .video__button:focus .video__button-shape {
65 fill: #ff0000;
66 fill-opacity: 1;
67 }
68
69 .video--enabled {
70 cursor: pointer
71 }
72
73 .video--enabled .video__button {
74 display: block
75 }
76
77 .video__title {
78 position: absolute;
79 top: 0;
80 color: white;
81 padding: 15px 10px 20px;
82 margin: 0 12px;
83 background: linear-gradient(rgba(0, 0, 0, 0.5), transparent);
84 right: 0;
85 left: 0;
86 font-weight: 400;
87 overflow: hidden;
88 white-space: nowrap;
89 text-overflow: ellipsis;
90 }
91
92 .video__placeholder {background-repeat: no-repeat;background-position: center;background-color: lightgrey;}
93 </style>
94 <div class="flex-container">
95 <#assign youtubeSvg = '
96 <svg viewBox="0 0 68 48">
97 <path class="video__button-shape"d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z"></path>
98 <path class="video__button-icon" d="M 45,24 27,14 27,34"></path>
99 </svg>
100 ' />
101 <#assign rutubeSvg = '
102 <svg viewBox="0 0 24 24">
103 <path d="M8 5v14l10-7L8 5Z" fill="white" stroke="white" stroke-width="1.24" stroke-linecap="round" stroke-linejoin="round"></path>
104 </svg>
105 '/>
106 <div style="display: none;">
107 <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
108 <symbol id="video__button_youtube" viewBox="0 0 68 48">
109 <path class="video__button-shape"
110 d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z">
111 </path>
112 <path class="video__button-icon" d="M 45,24 27,14 27,34"></path>
113 </symbol>
114 <symbol id="video__button_rutube" viewBox="0 0 24 24">
115 <path d="M8 5v14l10-7L8 5Z" fill="white" stroke="white" stroke-width="1.24" stroke-linecap="round" stroke-linejoin="round"></path>
116 </symbol>
117 </svg>
118 </div>
119
120 <#list entries as entry>
121 <#assign ddmFormFieldValuesMap = entry.getAssetRenderer().getDDMFormValuesReader().getDDMFormValues().getDDMFormFieldValuesMap() />
122 <#assign url = ddmFormFieldValuesMap['url'][0].getValue().getString(locale) />
123
124
125 <#if url?contains("rutube")>
126 <#assign svgIcon = rutubeSvg />
127 <#assign videoType = "rutube" />
128 <#assign videoTitle = ddmFormFieldValuesMap['title'][0].getValue().getString(locale) />
129 <#assign embedUrl = ddmFormFieldValuesMap['embedUrl'][0].getValue().getString(locale) />
130 <#assign thumbnailJson = (ddmFormFieldValuesMap['thumbnail'][0].getValue().getString(locale))!"{}" />
131 <#if thumbnailJson?length gt 3 >
132 <#assign thumbnail = jsonFactoryUtil.looseDeserialize(thumbnailJson) />
133 <#assign thumbnailUrl = "/documents/${thumbnail.groupId}/0/${thumbnail.title}/${thumbnail.uuid}" />
134 <#assign thumbnailUrl = httpUtil.encodePath(thumbnailUrl) />
135 </#if>
136 <#elseif url?contains("youtu")>
137 <#assign svgIcon = youtubeSvg />
138 <#assign id = url?matches("(?:youtube\\.com\\/(?:[^\\/]+\\/.+\\/|(?:v|e(?:mbed)?)\\/|.*[?&]v=)|youtu\\.be\\/)([^\"&?\\/ ]{11})")[0]?groups[1]/>
139
140 <#assign videoType = "youtube" />
141 <#assign videoTitle = entry.getTitle(locale) />
142 <#assign thumbnailUrl = "https://i.ytimg.com/vi/" + id + "/mqdefault.jpg" />
143 <#assign embedUrl = "https://www.youtube.com/embed/" + id + "?rel=0&showinfo=0&autoplay=1" />
144 <#else>
145 <#assign videoType = "" />
146 <#assign videoTitle = "" />
147 <#assign thumbnailUrl = "" />
148 <#assign embedUrl = "" />
149 </#if>
150
151
152 <#if url?contains("vkvideo")>
153
154 <iframe
155 src="${url}"
156 width="350"
157 height="200"
158 allow="encrypted-media; fullscreen; picture-in-picture; screen-wake-lock;"
159 frameborder="0"
160 allowfullscreen>
161 </iframe>
162
163 <#else>
164
165 <div class="col-md-6 col-12 mb-1 video video_${videoType}" data-embed="${embedUrl}">
166 <a class="video__link" href="${url}">
167 <#if thumbnailUrl?has_content>
168 <img class="video__media" src="${thumbnailUrl}">
169 <#else>
170 <img class="video__media video__placeholder">
171 </#if>
172 </a>
173 <h3 class="video__title">${videoTitle}</h3>
174 <button class="video__button" type="button" aria-label="Запустить видео">
175 <!--<svg><use href="#video__button_${videoType}"></use></svg>-->
176 ${svgIcon}
177 </button>
178 </div>
179
180 </#if>
181
182
183
184 </#list>
185 </div>
186 <script>
187
188 if (!('remove' in Element.prototype)) {
189 Element.prototype.remove = function() {
190 if (this.parentNode) {
191 this.parentNode.removeChild(this);
192 }
193 };
194 }
195
196 function findVideos() {
197 let videos = document.querySelectorAll('.video');
198
199 for (let i = 0; i < videos.length; i++) {
200 setupVideo(videos[i]);
201 }
202 }
203
204 var videoIframes = [];
205
206 function setupVideo(video) {
207 let link = video.querySelector('.video__link');
208 let button = video.querySelector('.video__button');
209 let title = video.querySelector('.video__title');
210 let embedUrl = video.dataset.embed;
211
212 video.addEventListener('click', function() {
213 let iframe = createIframe(embedUrl);
214
215 link.remove();
216 button.remove();
217 title.remove();
218 video.appendChild(iframe);
219
220 videoIframes.push(iframe);
221 });
222
223 link.removeAttribute('href');
224 video.classList.add('video--enabled');
225 }
226
227 function createIframe(src) {
228 let iframe = document.createElement('iframe');
229
230 iframe.setAttribute('allowfullscreen', '');
231 iframe.setAttribute('allow', 'autoplay');
232 iframe.setAttribute('src', src);
233 iframe.classList.add('video__media');
234
235 return iframe;
236 }
237
238 function messageProcessor(event) {
239 for (const videoFrame of videoIframes) {
240 if (videoFrame.contentWindow === event.source) {
241 const message = JSON.parse(event.data);
242 if (message.type === 'player:ready') {
243 console.log('player initiated')
244 videoFrame.dataset.state = 'init'
245 }
246 if (message.type === 'player:buffering' && videoFrame.dataset.state === 'init') {
247 console.log('start playing')
248 videoFrame.dataset.state = 'playing'
249 videoFrame.contentWindow.postMessage('{"type":"player:play","data":{}}', '*');
250 }
251 if (message.type === "player:rollState") {
252 if(message.data.state === 'play'){
253 videoFrame.dataset.state = 'ad'
254 console.log('ad start')
255 videoFrame.contentWindow.postMessage('{"type":"player:pause","data":{}}', '*');
256 }
257 if(message.data.state === 'complete'){
258 videoFrame.dataset.state = 'playing'
259 console.log('ad complete')
260 videoFrame.contentWindow.postMessage('{"type":"player:play","data":{}}', '*');
261 }
262 }
263 }
264 }
265 }
266
267 findVideos();
268 window.addEventListener('message', messageProcessor);
269
270 Liferay.once('beforeNavigate', function(event) {
271 console.log("remove videos")
272 for (const videoFrame of videoIframes) {
273 videoFrame.contentWindow.postMessage('{"type":"player:remove"}', '*');
274 }
275
276 videoIframes = [];
277 window.removeEventListener('message', messageProcessor);
278 });
279 </script>
280</#if>
Виниры - это тонкая адгезивная облицовка,покрывающая вестибулярную поверхность фронтального зуба,корректирующая его цвет и форму дающая улучшение эстетики зубного ряда и лица. Различают виниры в зависимости от ряда особенностей:
- по функциям: цветокорригирующие, формокоррегирующие, сочетанные.
- по материалу: керамика, акрил, микронаполненные и макронаполненные гибридные композиты.
- по методу изготовления: индивидуально, стандартные, прямые, не прямые, комбинированные.
- по размеру: полный, не полный, полувинир.
Продолжительность использования: временные, постоянные.
Показания к применению виниров следующие: изменение цвета депульпированного зуба, дисколорит вследствие травмы зуба, тетрациклиновые, миноциклиновые зубы, нарушение минерализации зуба.
Противопоказания к применению виниров: патология прикуса, бруксизм, наличие кардиостимулятора.
БЕРЕГИТЕ СВОИ ЗУБЫ!
Врач - стоматолог Курмашева А.А.