From f64096d1767df683952cc5a56e94f0035a5a0732 Mon Sep 17 00:00:00 2001 From: dignajar Date: Wed, 30 Dec 2015 21:35:28 -0300 Subject: [PATCH] New Bludit Images system v8 and Cover image --- kernel/admin/themes/default/css/default.css | 16 +++++++++++- kernel/admin/themes/default/init.php | 27 +++++++++++++++------ kernel/admin/views/edit-page.php | 2 +- kernel/admin/views/edit-post.php | 2 +- kernel/dbpages.class.php | 3 ++- kernel/dbposts.class.php | 3 ++- kernel/page.class.php | 5 ++++ kernel/post.class.php | 5 ++++ 8 files changed, 51 insertions(+), 12 deletions(-) diff --git a/kernel/admin/themes/default/css/default.css b/kernel/admin/themes/default/css/default.css index 260e2800..fc687c9d 100644 --- a/kernel/admin/themes/default/css/default.css +++ b/kernel/admin/themes/default/css/default.css @@ -102,11 +102,15 @@ li.bludit-logo { } .uk-thumbnail { - margin: 2px 4px !important; + margin: 2px 3px !important; max-width: 30% !important; padding: 0 !important; } +.uk-progress-bar { + background: #2672ec !important; +} + /* ----------- BLUDIT ----------- */ #logo { @@ -185,6 +189,7 @@ button.delete-button:hover { #bludit-images-v8-progressbar { display: none; + margin: 20px; } #bludit-images-v8-thumbnails { @@ -211,6 +216,10 @@ button.delete-button:hover { font-size: 0.9em; } +#bludit-quick-images-thumbnails { + text-align: center; +} + /* ----------- BLUDIT COVER IMAGE ----------- */ #bludit-cover-image { @@ -246,6 +255,11 @@ button.delete-button:hover { #cover-image-progressbar { display: none; + left: 5%; + position: relative; + top: 33%; + width: 90%; + } /* ----------- LOGIN FORM ----------- */ diff --git a/kernel/admin/themes/default/init.php b/kernel/admin/themes/default/init.php index d86250b7..812f941d 100644 --- a/kernel/admin/themes/default/init.php +++ b/kernel/admin/themes/default/init.php @@ -157,21 +157,28 @@ $html .= ' echo $html; } - public static function bluditCoverImage() + public static function bluditCoverImage($coverImage="") { global $L; + $style = ''; + if(!empty($coverImage)) { + $style = 'background-image: url('.HTML_PATH_UPLOADS_THUMBNAILS.$coverImage.')'; + } + $html = ''; $html .= '
-
+
-
+ + +
'.$L->g('Cover image').'
-
'.$L->g('Drag and drop or click here').'
+
'.$L->g('Drag and drop or click here').'
-
+
@@ -189,6 +196,7 @@ $(document).ready(function() { $("#cover-image-delete").on("click", function() { $("#cover-image-thumbnail").attr("style",""); + $("#cover-image-upload-filename").attr("value",""); $("#cover-image-delete").hide(); $("#cover-image-upload").show(); }); @@ -202,7 +210,7 @@ $(document).ready(function() { loadstart: function() { $("#cover-image-progressbar").find(".uk-progress-bar").css("width", "0%").text("0%"); - $("#cover-image-progressbar").hide(); + $("#cover-image-progressbar").show(); $("#cover-image-delete").hide(); $("#cover-image-upload").hide(); }, @@ -222,6 +230,8 @@ $(document).ready(function() { $("img:last-child", "#bludit-quick-images-thumbnails").remove(); $("#bludit-quick-images-thumbnails").prepend("\"Thumbnail\""); + + $("#cover-image-upload-filename").attr("value",response.filename); }, notallowed: function(file, settings) { @@ -251,7 +261,7 @@ $html .= '
'.$L->g('Upload image').'
-
'.$L->g('Drag and drop or click here').'
+
'.$L->g('Drag and drop or click here').'
@@ -310,6 +320,8 @@ $(document).ready(function() { loadstart: function() { $("#bludit-images-v8-progressbar").find(".uk-progress-bar").css("width", "0%").text("0%"); + $("#bludit-images-v8-drag-drop").hide(); + $("#bludit-images-v8-progressbar").show(); }, progress: function(percent) { @@ -320,6 +332,7 @@ $(document).ready(function() { allcomplete: function(response) { $("#bludit-images-v8-progressbar").find(".uk-progress-bar").css("width", "100%").text("100%"); $("#bludit-images-v8-progressbar").hide(); + $("#bludit-images-v8-drag-drop").show(); // Images V8 Thumbnails var imageSrc = HTML_PATH_UPLOADS_THUMBNAILS+response.filename; diff --git a/kernel/admin/views/edit-page.php b/kernel/admin/views/edit-page.php index d41c43d8..6711b587 100644 --- a/kernel/admin/views/edit-page.php +++ b/kernel/admin/views/edit-page.php @@ -91,7 +91,7 @@ echo '