From 02f57502c331021893a247c882e5bbe99a22671d Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Tue, 20 Feb 2018 19:59:03 +0100 Subject: [PATCH] =?UTF-8?q?Presentaci=C3=B3n=20de=20videos=20en=20modo=20'?= =?UTF-8?q?responsive'=20por=20defecto=20usando=20los=20estilos=20del=20ed?= =?UTF-8?q?itor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/ckeditor.yml | 7 ++++--- .../ckeditor-contrib/plugins/youtube/lang/es.js | 13 +++++++------ .../ckeditor-contrib/plugins/youtube/plugin.js | 4 ++-- .../themes/circlepro/stylesheets/application.css | 2 +- public/themes/circlepro/stylesheets/editor.css | 16 ++++++++++++++++ 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/config/ckeditor.yml b/config/ckeditor.yml index 3c6952b..636b5a5 100644 --- a/config/ckeditor.yml +++ b/config/ckeditor.yml @@ -1,5 +1,4 @@ -# CKEditor configuration - +# CKEditor configuration: contentsCss: '/themes/circlepro/stylesheets/editor.css' allowedContent: true bodyClass: 'wiki' @@ -7,8 +6,10 @@ removePlugins: 'codemirror,div,flash,forms,iframe,copyformatting,elementspath' forcePasteAsPlainText: false entities: false -# HTML sanitizer configuration +# Youtube plugin defaults: +youtube_responsive: true +# HTML sanitizer configuration: allowedProtocols: - afs - aim diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/youtube/lang/es.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/youtube/lang/es.js index c567cb1..525fe3f 100755 --- a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/youtube/lang/es.js +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/youtube/lang/es.js @@ -1,12 +1,12 @@ CKEDITOR.plugins.setLang('youtube', 'es', { button : 'Embed YouTube video', title : 'Embed YouTube video', - txtEmbed : 'Pegar el código embed', - txtUrl : 'Pegar la URL al video de Youtube', + txtEmbed : 'Pegar directamente el código embed', + txtUrl : 'Usar la URL y opciones del video de Youtube', txtWidth : 'Anchura', txtHeight : 'Altura', - chkRelated : 'Mostrar videos sugeridos al final de este video', - txtStartAt : 'Comenzar en (ss or mm:ss or hh:mm:ss)', + chkRelated : 'Mostrar videos sugeridos al final del video', + txtStartAt : 'Comenzar en (ss ó mm:ss ó hh:mm:ss)', chkPrivacy : 'Habilitar el modo privacy-enhanced', chkOlderCode : 'Usar código embed viejo', chkAutoplay: 'Autoplay', @@ -14,11 +14,12 @@ CKEDITOR.plugins.setLang('youtube', 'es', { noCode : 'Debes de introducir un código embed o URL', invalidEmbed : 'El código embed introducido parece no ser valido', invalidUrl : 'La URL introducida parece no ser valida', - or : 'o', + or : 'ó', noWidth : 'Debes de dar la anchura', invalidWidth : 'Da una anchura valida', noHeight : 'Debes dar una altura valida', invalidHeight : 'Da una altura valida', invalidTime : 'Da un tiempo de valido', - txtResponsive : 'Hacer responsivo (ignorar anchura y altura, ajustar a la anchura)' + txtResponsive : 'Ajustar al ancho manteniendo proporción', + txtNoEmbed : 'Sólo imagen del video y enlace' }); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/youtube/plugin.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/youtube/plugin.js index 82e4442..f910e7b 100755 --- a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/youtube/plugin.js +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/youtube/plugin.js @@ -277,8 +277,8 @@ } if (this.getContentElement('youtubePlugin', 'chkResponsive').getValue() === true) { - content += '
'; - responsiveStyle = 'style="position:absolute;top:0;left:0;width:100%;height:100%"'; + content += '
'; + responsiveStyle = 'class="responsive-view"'; } if (this.getContentElement('youtubePlugin', 'chkOlderCode').getValue() === true) { diff --git a/public/themes/circlepro/stylesheets/application.css b/public/themes/circlepro/stylesheets/application.css index be92ecb..c084164 100644 --- a/public/themes/circlepro/stylesheets/application.css +++ b/public/themes/circlepro/stylesheets/application.css @@ -80,6 +80,7 @@ div#content h1 { div.journal div[id^="note-"] > h4:first-child { font-size: 13px; padding-right: 0; + margin: 10px 0 20px; line-height: 15px; } .journal-link { @@ -98,7 +99,6 @@ h4 img.gravatar { display: block; float: left; margin-right: 6px; - margin-bottom: 4px; } div.gravatar-with-child > img.gravatar:nth-child(2) { border: solid 1px #d5d5d5; diff --git a/public/themes/circlepro/stylesheets/editor.css b/public/themes/circlepro/stylesheets/editor.css index a40985c..866c838 100644 --- a/public/themes/circlepro/stylesheets/editor.css +++ b/public/themes/circlepro/stylesheets/editor.css @@ -84,6 +84,22 @@ hr { border: 0; } +/* Youtube plugin */ +div.youtube-embed-wrapper { + position: relative; + padding-bottom: 56.25%; + padding-top: 30px; + height: 0; + overflow: hidden; +} +div.youtube-embed-wrapper .responsive-view { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + /* Responsive */ @media screen and (max-width: 767px) { .wiki p, .wiki li {