From d02fea28ea48defd9729a4d5811c4cd41627205a Mon Sep 17 00:00:00 2001 From: Matthias Mees Date: Mon, 3 Jun 2013 13:20:41 +0200 Subject: [PATCH] A more usable overlay for media files; fixed duplicate ids. This looks about the same as @onli's solution, but more usable on smaller and/or touch devices since it's triggered by a button which also makes sense if JS is deactivated. Has a no-js fallback, too. --- templates/2k11/admin/media_items.tpl | 56 +++++++++---------- .../2k11/admin/serendipity_editor.js.tpl | 6 ++ templates/2k11/admin/style.css | 42 ++++++-------- 3 files changed, 51 insertions(+), 53 deletions(-) diff --git a/templates/2k11/admin/media_items.tpl b/templates/2k11/admin/media_items.tpl index ccfda04b..c3b29cc7 100644 --- a/templates/2k11/admin/media_items.tpl +++ b/templates/2k11/admin/media_items.tpl @@ -69,44 +69,44 @@ {/if} {/if} + - - {if $file.is_editable} {/if} diff --git a/templates/2k11/admin/serendipity_editor.js.tpl b/templates/2k11/admin/serendipity_editor.js.tpl index 1b8bba19..382bb728 100644 --- a/templates/2k11/admin/serendipity_editor.js.tpl +++ b/templates/2k11/admin/serendipity_editor.js.tpl @@ -719,6 +719,12 @@ function highlightComment(id, checkvalue) { addUploadField(); }); + // Show media file info + $('.media_show_info').click(function(e) { + $($(this).attr('href')).toggleClass('additional_info'); + e.preventDefault(); + }); + // Clone media library $('.media_pane .pagination').clone().prependTo('.media_pane'); $('.comments_pane .pagination').clone().insertAfter('.comments_pane > h3'); diff --git a/templates/2k11/admin/style.css b/templates/2k11/admin/style.css index ac50f7f2..2ce8bfcf 100644 --- a/templates/2k11/admin/style.css +++ b/templates/2k11/admin/style.css @@ -1242,9 +1242,7 @@ form > .button_link:first-of-type { margin-top: 0; } #serendipityScaleImg img { max-width: 99%; } -#template_select .preview_image, -.media_file_preview, -.media_file > div > footer { +#template_select .preview_image { float: left; margin: 0 1em 1em 0; } @@ -1429,38 +1427,31 @@ form > .button_link:first-of-type { margin-top: 0; } margin: 0 2% 1em 0; } -.media_file_wrap:hover > .media_file_meta { - -webkit-animation: fade-in 0.4s 1; - -moz-animation: fade-in 0.4s 1; - animation: fade-in 0.4s 1; - display: block; - opacity: 1; +.no-js .media_file_preview img { + margin: 0 0 1em; } -.media_file_meta { - background-color: rgba(0,0,0,.6); +.js .media_file_preview { + position: relative; +} + +.js .media_file_meta { + background: #000; + background: rgba(0,0,0,.6); -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; color: #fcfcfc; - display: none; - opacity: 0; padding: .5em 1em; position: absolute; + top: 0; + left: 0; + width: 100%; } -@-webkit-keyframes fade-in { - 0% { opacity: 0; } - 100% { opacity: 1; } -} -@-moz-keyframes fade-in { - 0% { opacity: 0; } - 100% { opacity: 1; } -} - -@keyframes fade-in { - 0% { opacity: 0; } - 100% { opacity: 1; } +.js .additional_info { + display: none; + visibility: hidden; } input[name="serendipity[filter][fileCategory]"] { @@ -1470,6 +1461,7 @@ input[name="serendipity[filter][fileCategory]"] { .media_selector { cursor: pointer; } + input:checked + .media_selector { background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fff), color-stop(1px, #ddd), color-stop(100%, #eee)); background-image: -webkit-linear-gradient(#fff, #ddd 1px, #eee);