├── cccyoutubefield ├── language │ ├── de-DE │ │ ├── de-DE.plg_fields_cccyoutubefield.sys.ini │ │ └── de-DE.plg_fields_cccyoutubefield.ini │ └── en-GB │ │ ├── en-GB.plg_fields_cccyoutubefield.sys.ini │ │ └── en-GB.plg_fields_cccyoutubefield.ini ├── cccyoutubefield.php ├── tmpl │ └── cccyoutubefield.php ├── media │ ├── js │ │ └── cccyoutubefield.js │ └── css │ │ └── cccyoutubefield.css └── cccyoutubefield.xml ├── README.md └── manifest.xml /cccyoutubefield/language/de-DE/de-DE.plg_fields_cccyoutubefield.sys.ini: -------------------------------------------------------------------------------- 1 | PLG_FIELDS_CCCYOUTUBEFIELD ="CCC Youtube Feld" 2 | PLG_FIELDS_CCCYOUTUBEFIELD_XML_DESCRIPTION = "" -------------------------------------------------------------------------------- /cccyoutubefield/language/en-GB/en-GB.plg_fields_cccyoutubefield.sys.ini: -------------------------------------------------------------------------------- 1 | PLG_FIELDS_CCCYOUTUBEFIELD ="CCC Youtube Feld" 2 | PLG_FIELDS_CCCYOUTUBEFIELD_XML_DESCRIPTION = "" -------------------------------------------------------------------------------- /cccyoutubefield/language/en-GB/en-GB.plg_fields_cccyoutubefield.ini: -------------------------------------------------------------------------------- 1 | PLG_FIELDS_CCCYOUTUBEFIELD_LABEL="CCC Youtube Field (%s)" 2 | PLG_FIELDS_CCCYOUTUBEFIELD ="CCC Youtube Field" 3 | PLG_FIELDS_CCCYOUTUBEFIELD_XML_DESCRIPTION = "Joomla! CustomField - Adds a youtube video with responsive container. The video is loaded when the user clicks on the preview." -------------------------------------------------------------------------------- /cccyoutubefield/language/de-DE/de-DE.plg_fields_cccyoutubefield.ini: -------------------------------------------------------------------------------- 1 | PLG_FIELDS_CCCYOUTUBEFIELD_LABEL="CCC Youtube Feld (%s)" 2 | PLG_FIELDS_CCCYOUTUBEFIELD ="CCC Youtube Feld" 3 | PLG_FIELDS_CCCYOUTUBEFIELD_XML_DESCRIPTION = "Joomla! CustomField - Fügt ein Youtube Video mit responsivem Container hinzu.
Das Video wird erst geladen wenn man auf das Vorschaubild klickt." -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cccyoutubefield 2 | CustomField plugin for Joomla! - Responsive Youtube embed with „load on click" 3 | 4 | ## Installation 5 | Install this plugin through the Joomla! Extensions Manager 6 | 7 | ## Usage 8 | Type in the Video-ID of your Youtube Video into the textbox. The video is rendered in the frontend with the preview-image in a responsive container. If you click on the container the video is loaded. 9 | -------------------------------------------------------------------------------- /cccyoutubefield/cccyoutubefield.php: -------------------------------------------------------------------------------- 1 | value; 13 | 14 | if (!$value) 15 | { 16 | return; 17 | } 18 | 19 | // Loading the javascript and css 20 | JHtml::_('stylesheet', 'plg_fields_cccyoutubefield/cccyoutubefield.css', array('version' => 'auto', 'relative' => true)); 21 | JHtml::_('script', 'plg_fields_cccyoutubefield/cccyoutubefield.js', array('version' => 'auto', 'relative' => true)); 22 | 23 | if (is_array($value)) 24 | { 25 | $value = implode(', ', $value); 26 | } 27 | 28 | ?> 29 | 30 |
31 |
32 |
33 | -------------------------------------------------------------------------------- /manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CCC Youtube Field 4 | Joomla! CustomField - Adds a youtube video with responsive container. The video is loaded when the user clicks on the preview. 5 | cccyoutubefield 6 | plugin 7 | fields 8 | site 9 | 1.0-beta 10 | 11 | https://github.com/coolcat-creations/cccyoutubefield/archive/v1.0-beta.zip 12 | 13 | 14 | beta 15 | 16 | 17 | https://github.com/coolcat-creations/cccyoutubefield/blob/master/README.md 18 | 19 | Elisa Foltyn 20 | https://www.coolcat-creations.com 21 | 22 | 23 | -------------------------------------------------------------------------------- /cccyoutubefield/media/js/cccyoutubefield.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 3 | document.addEventListener('DOMContentLoaded', function() { 4 | 5 | ( function() { 6 | 7 | var youtube = document.querySelectorAll( ".cccyoutubefield" ); 8 | 9 | for (var i = 0; i < youtube.length; i++) { 10 | 11 | var source = "https://img.youtube.com/vi/"+ youtube[i].dataset.embed +"/sddefault.jpg"; 12 | 13 | var image = new Image(); 14 | image.src = source; 15 | image.addEventListener( "load", function() { 16 | youtube[ i ].appendChild( image ); 17 | }( i ) ); 18 | 19 | youtube[i].addEventListener( "click", function() { 20 | 21 | var iframe = document.createElement( "iframe" ); 22 | 23 | iframe.setAttribute( "frameborder", "0" ); 24 | iframe.setAttribute( "allowfullscreen", "" ); 25 | iframe.setAttribute( "src", "https://www.youtube.com/embed/"+ this.dataset.embed +"?rel=0&showinfo=0&autoplay=1" ); 26 | 27 | this.innerHTML = ""; 28 | this.appendChild( iframe ); 29 | } ); 30 | }; 31 | 32 | } )(); 33 | }); 34 | 35 | })(); -------------------------------------------------------------------------------- /cccyoutubefield/cccyoutubefield.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | plg_fields_cccyoutubefield 4 | Elisa Foltyn 5 | 2017 6 | Copyright (C) 2017 - coolcat-creations.com, Elisa Foltyn 7 | GNU General Public License version 2 or later; see LICENSE.txt 8 | contact@coolcat-creations.com 9 | www.coolcat-creations.com 10 | 1.0 11 | PLG_FIELDS_CCCYOUTUBEFIELD_XML_DESCRIPTION 12 | 13 | https://raw.githubusercontent.com/coolcat-creations/cccyoutubefield/master/manifest.xml 14 | 15 | 16 | cccyoutubefield.php 17 | tmpl 18 | 19 | 20 | css 21 | js 22 | 23 | 24 | en-GB/en-GB.plg_fields_cccyoutubefield.ini 25 | en-GB/en-GB.plg_fields_cccyoutubefield.sys.ini 26 | de-DE/de-DE.plg_fields_cccyoutubefield.ini 27 | de-DE/de-DE.plg_fields_cccyoutubefield.sys.ini 28 | 29 | 30 | -------------------------------------------------------------------------------- /cccyoutubefield/media/css/cccyoutubefield.css: -------------------------------------------------------------------------------- 1 | .cccyoutubefield-container { 2 | position: relative; 3 | padding-bottom: 56.25%; 4 | padding-top: 30px; height: 0; overflow: hidden; 5 | } 6 | 7 | .cccyoutubefield { 8 | background-color: #000; 9 | margin-bottom: 30px; 10 | position: relative; 11 | padding-bottom: 56.25%; 12 | overflow: hidden; 13 | cursor: pointer; 14 | padding-top: 30px; 15 | height: 0; 16 | 17 | } 18 | .cccyoutubefield img { 19 | width: 100%; 20 | top: -16.84%; 21 | left: 0; 22 | opacity: 0.7; 23 | } 24 | 25 | .cccyoutubefield iframe, 26 | .cccyoutubefield object, 27 | .cccyoutubefield embed, 28 | .cccyoutubefield img { 29 | position: absolute; 30 | top: 0; 31 | left: 0; 32 | width: 100%; 33 | height: 100%; 34 | } 35 | 36 | .cccyoutubefield .play-button { 37 | width: 90px; 38 | height: 60px; 39 | background-color: #333; 40 | box-shadow: 0 0 30px rgba( 0,0,0,0.6 ); 41 | z-index: 1; 42 | opacity: 0.8; 43 | border-radius: 6px; 44 | } 45 | .cccyoutubefield .play-button:before { 46 | content: ""; 47 | border-style: solid; 48 | border-width: 15px 0 15px 26.0px; 49 | border-color: transparent transparent transparent #fff; 50 | } 51 | .cccyoutubefield img, 52 | .cccyoutubefield .play-button { 53 | cursor: pointer; 54 | } 55 | .cccyoutubefield img, 56 | .cccyoutubefield iframe, 57 | .cccyoutubefield .play-button, 58 | .cccyoutubefield .play-button:before { 59 | position: absolute; 60 | } 61 | .cccyoutubefield .play-button, 62 | .cccyoutubefield .play-button:before { 63 | top: 50%; 64 | left: 50%; 65 | transform: translate3d( -50%, -50%, 0 ); 66 | } 67 | .cccyoutubefield iframe { 68 | height: 100%; 69 | width: 100%; 70 | top: 0; 71 | left: 0; 72 | } --------------------------------------------------------------------------------