From bfa4756bf4418543e7f609d2a6c21290e3e640df Mon Sep 17 00:00:00 2001 From: dignajar Date: Tue, 9 Feb 2016 20:02:51 -0300 Subject: [PATCH] New Menu V8 for Images and improves on cover images --- .../admin/themes/default/css/default.css | 30 ++ bl-kernel/admin/themes/default/init.php | 325 +++++------------- bl-kernel/admin/views/edit-page.php | 3 + bl-kernel/admin/views/edit-post.php | 3 + bl-kernel/admin/views/new-page.php | 3 + bl-kernel/admin/views/new-post.php | 3 + bl-kernel/ajax/delete-file.php | 31 ++ bl-kernel/ajax/slug.php | 4 +- bl-kernel/helpers/theme.class.php | 1 + bl-kernel/js/bludit-cover-image.js | 96 ++++++ bl-kernel/js/bludit-images-v8.js | 68 ++++ bl-kernel/js/bludit-menu-v8.js | 144 ++++++++ bl-kernel/js/bludit-quick-images.js | 33 ++ bl-languages/en_US.json | 8 +- bl-plugins/simplemde/plugin.php | 10 +- install.php | 2 +- 16 files changed, 523 insertions(+), 241 deletions(-) create mode 100644 bl-kernel/ajax/delete-file.php create mode 100644 bl-kernel/js/bludit-cover-image.js create mode 100644 bl-kernel/js/bludit-images-v8.js create mode 100644 bl-kernel/js/bludit-menu-v8.js create mode 100644 bl-kernel/js/bludit-quick-images.js diff --git a/bl-kernel/admin/themes/default/css/default.css b/bl-kernel/admin/themes/default/css/default.css index af0da748..958f0b5c 100644 --- a/bl-kernel/admin/themes/default/css/default.css +++ b/bl-kernel/admin/themes/default/css/default.css @@ -229,6 +229,36 @@ button.delete-button:hover { font-size: 0; } +/* Bludit Menu v8 */ + +#bludit-menuV8 { + display: none; + z-index: 1020; + position: absolute; + overflow: hidden; + border: 1px solid #CCC; + background: #FFF; + color: #333; + border-radius: 2px; + list-style-type: none; + padding: 5px; + margin: 0; +} + +#bludit-menuV8 li { + padding: 8px 12px; + cursor: pointer; +} + +#bludit-menuV8 li:hover { + background-color: #2672ec; + color: #fff; +} + +#bludit-menuV8 li i { + margin-right: 10px; +} + /* ----------- BLUDIT QUICK IMAGES ----------- */ #bludit-quick-images { diff --git a/bl-kernel/admin/themes/default/init.php b/bl-kernel/admin/themes/default/init.php index 5b271e07..a42dbdb2 100644 --- a/bl-kernel/admin/themes/default/init.php +++ b/bl-kernel/admin/themes/default/init.php @@ -249,60 +249,44 @@ $(document).ready(function() { public static function bluditQuickImages() { + // Javascript code + include(PATH_JS.'bludit-quick-images.js'); + global $L; -$html = ''; -$html .= ' -
-
-'; + $html = ''; + $html .= ' +
+
+ '; -$thumbnailList = Filesystem::listFiles(PATH_UPLOADS_THUMBNAILS,'*','*',true); -array_splice($thumbnailList, THUMBNAILS_AMOUNT); -foreach($thumbnailList as $file) { - $filename = basename($file); - $html .= 'Thumbnail'; -} + $thumbnailList = Filesystem::listFiles(PATH_UPLOADS_THUMBNAILS,'*','*',true); + array_splice($thumbnailList, THUMBNAILS_AMOUNT); + foreach($thumbnailList as $file) { + $filename = basename($file); + $html .= 'Thumbnail'; + } -$html .= ' -
-'; + $html .= ' +
+ '; -if(empty($thumbnailList)) { - $html .= '
'.$L->g('There are no images').'
'; -} + $html .= '
'.$L->g('There are no images').'
'; -$html .= ' -'.$L->g('More images').' + $html .= ' + '.$L->g('More images').' -
-'; +
+ '; -$script = ' - -'; - - echo $html.$script; + echo $html; } public static function bluditCoverImage($coverImage="") { + // Javascript code + include(PATH_JS.'bludit-cover-image.js'); + global $L; $style = ''; @@ -310,225 +294,106 @@ function addQuickImages(filename) $style = 'background-image: url('.HTML_PATH_UPLOADS_THUMBNAILS.$coverImage.')'; } -$html = ''; -$html .= ' -
-
+ $html = ''; + $html .= ' +
+
- + -
-
'.$L->g('Cover image').'
-
'.$L->g('Drag and drop or click here').'
-
+
+
'.$L->g('Cover image').'
+
'.$L->g('Drag and drop or click here').'
+
-
-
-
+
+
+
-
-
0%
-
+
+
0%
+
-
-
-'; +
+
+ '; -$script = ' - -'; - echo $html.$script; + echo $html; } public static function bluditImagesV8() { + // Javascript code + include(PATH_JS.'bludit-images-v8.js'); + global $L; -$html = ''; -$html .= ' -
-
+ $html = ''; + $html .= ' +
+
-
+
-
-
'.$L->g('Upload image').'
-
'.$L->g('Drag and drop or click here').'
-
+
+
'.$L->g('Upload image').'
+
'.$L->g('Drag and drop or click here').'
+
-
-
0%
-
+
+
0%
+
-
+
-
-'; +
+ '; -$thumbnailList = Filesystem::listFiles(PATH_UPLOADS_THUMBNAILS,'*','*',true); -foreach($thumbnailList as $file) { - $filename = basename($file); - $html .= 'Thumbnail'; -} - -$html .= ' -
-'; - -if(empty($thumbnailList)) { - $html .= '
'.$L->g('There are no images').'
'; -} - -$html .= ' - - -
-
-'; - -$script = ' - -'; - echo $html.$script; + echo $html; } + + public static function profileUploader($username) { global $L; diff --git a/bl-kernel/admin/views/edit-page.php b/bl-kernel/admin/views/edit-page.php index a58d8413..95012756 100644 --- a/bl-kernel/admin/views/edit-page.php +++ b/bl-kernel/admin/views/edit-page.php @@ -102,6 +102,9 @@ echo '