Каталог файловtilda-t937-videoplaylist-1.0.js
401 }402 }403 var videoPart = t937_translate('videoPart');404 if (subheading) subheading.textContent = size + ' ' + videoPart;405}406 407function t937_renderFade(recid, color) {408 color = color.length ? color : '#ffffff';409 var rec = document.getElementById('rec' + recid);410 var playlistFade = rec ? rec.querySelector('.t937__playlist-fade') : null;411 var colorFrom = t937_hex2rgb(color, 0);412
История файла и сравнение версий
var colorTo = t937_hex2rgb(color, 1);
413 if (playlistFade) playlistFade.style.backgroundImage = 'linear-gradient(' + colorFrom + ' 0%, ' + colorTo + ' 90%)'; 416/*function t937_parseDescription(string) { 418 var parts = string.split('<br>'); 421 parts.forEach(function (part) { 423 res = document.createElement('br'); 426 res = document.createElement('p'); 427 res.classList.add('t937__paragraph'); 428 res.textContent = part; 435function t937_setSizes(recid, styles) { 436 var rec = document.getElementById('rec' + recid); 437 var playlistWrapper = rec ? rec.querySelector('.t937__playlist-wrap') : null; 438 var iframe = rec ? rec.querySelector('.t937__video-frame') : null; 439 var playlistCol = rec ? rec.querySelector('.t937__col_playlist') : null; 440 var description = rec ? rec.querySelector('.t937__description') : null; 441 var videoCol = rec ? rec.querySelector('.t937__video') : null; 442 var videoColWidth = videoCol ? videoCol.offsetWidth : 0; 444 /* Set 9:16 player sides */ 445 var height = videoColWidth * 0.5625; 446 if (iframe) iframe.setAttribute('height', height.toString()); 448 if (window.innerWidth >= 960) { 449 if (description) description.style.width = videoColWidth + 'px'; 450 if (playlistWrapper) playlistWrapper.style.height = height + 'px'; 451 if (playlistWrapper) playlistWrapper.style.maxHeight = ''; 453 if (styles.playlistWidth.length) { 454 if (playlistCol) playlistCol.style.width = parseInt(styles.playlistWidth, 10) + 'px'; 457 if (playlistWrapper) playlistWrapper.style.maxHeight = height + 'px'; 458 if (playlistWrapper) playlistWrapper.style.height = ''; 459 if (playlistCol) playlistCol.style.width = ''; 460 if (description) description.style.width = ''; 464function t937_translate(keyword) { 467 dict['videoTitle'] = { 469 EN: 'Untitled video', 470 FR: 'Vidéo sans titre', 471 DE: 'Video ohne Titel', 472 ES: 'Video sin título', 473 PT: 'Bez tytułu wideo', 474 UK: 'Відео без назви', 480 dict['videoPart'] = { 494 RU: 'Пожалуйста, добавьте хотя бы одно видео в плейлист', 495 EN: 'Please add at least one video to the playlist', 496 UK: 'Будь ласка, додайте хоча б одне відео в плейлист', 497 PL: 'Proszę dodać jeden filmik do listy', 500 dict['wrongFormat'] = {