diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-27 01:55:12 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-27 01:55:12 +0300 |
| commit | 6e749800d8a9f6b77bf50be92a70b7916c2804f3 (patch) | |
| tree | 3d6ba2eb67fa11f228b756e0f84ef8ecb3f6ff34 /public/assets | |
| parent | 546daa78721e6abdbc89afcecc158118c2239865 (diff) | |
| download | classroom-6e749800d8a9f6b77bf50be92a70b7916c2804f3.tar.gz classroom-6e749800d8a9f6b77bf50be92a70b7916c2804f3.tar.bz2 classroom-6e749800d8a9f6b77bf50be92a70b7916c2804f3.zip | |
hotfixes and optimizations
Diffstat (limited to 'public/assets')
| -rw-r--r-- | public/assets/css/class.css | 4 | ||||
| -rw-r--r-- | public/assets/js/lesson-features.js | 21 |
2 files changed, 23 insertions, 2 deletions
diff --git a/public/assets/css/class.css b/public/assets/css/class.css index 5ad26c4..5252975 100644 --- a/public/assets/css/class.css +++ b/public/assets/css/class.css @@ -389,4 +389,6 @@ .classroom footer .no-list-mark ul li { margin: 0 0 4px 0; } -.classroom .page-container { max-width: 1024px; }
\ No newline at end of file +.classroom .page-container { max-width: 1024px; } + +iframe .ytp-chrome-top-buttons { display: none !important; }
\ No newline at end of file diff --git a/public/assets/js/lesson-features.js b/public/assets/js/lesson-features.js index 3634aa3..189b301 100644 --- a/public/assets/js/lesson-features.js +++ b/public/assets/js/lesson-features.js @@ -2,7 +2,9 @@ const valid_codeblocks = [ // supported sort-code keys 'youtube', 'spotify', 'spotify-track', - 'world-data' + 'world-data', + 'vimeo', + 'dailymotion' ]; @@ -35,6 +37,15 @@ var owid_template = ( id => { // our world in data (explorer) return '<iframe src="https://ourworldindata.org/explorers/'+ id +'?zoomToSelection=true&hideControls=true" loading="lazy" style="width: 100%; height: 480px; border: 0px none;"></iframe>' }); +var vimeo_template = ( id => { + return '<div style="padding:56.25% 0 0 0;position:relative;"><iframe src="https://player.vimeo.com/video/'+ id +'?h=2e7bdb3901&title=0&byline=0&portrait=0" style="position:absolute;top:0;left:0;width:100%;height:100%;" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe></div><script src="https://player.vimeo.com/api/player.js"></script>' +}); + +var dailymotion_template = ( id => { + return '<div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;"> <iframe style="width:100%;height:100%;position:absolute;left:0px;top:0px;overflow:hidden" frameborder="0" type="text/html" src="https://www.dailymotion.com/embed/video/'+ id +'" width="100%" height="100%" allowfullscreen title="Dailymotion Video Player" > </iframe> </div>' +}); + + /** inject_codeblocks * --- -- -- - - - @@ -98,6 +109,14 @@ function inject_codeblocks(code) { codeblock = owid_template(id); break; + case 'vimeo': + codeblock = vimeo_template(id); + break; + + case 'dailymotion': + codeblock = dailymotion_template(id); + break; + default: codeblock = id; |
