From 08ff8b59303f830591f0c5c21f90b2f646d090f0 Mon Sep 17 00:00:00 2001 From: dignajar Date: Sun, 3 Jan 2016 18:04:54 -0300 Subject: [PATCH] Improves Bludit Images v8 --- install.php | 19 ++-- kernel/admin/themes/default/css/default.css | 26 +++++- kernel/admin/themes/default/img/default.jpg | Bin 1491 -> 0 bytes kernel/admin/themes/default/img/default.png | Bin 0 -> 2634 bytes kernel/admin/themes/default/init.php | 93 ++++++++++++++++---- 5 files changed, 110 insertions(+), 28 deletions(-) delete mode 100644 kernel/admin/themes/default/img/default.jpg create mode 100644 kernel/admin/themes/default/img/default.png diff --git a/install.php b/install.php index 3ec6ea5c..8bd84b0a 100644 --- a/install.php +++ b/install.php @@ -24,6 +24,7 @@ define('PATH_CONTENT', PATH_ROOT.'content'.DS); define('PATH_POSTS', PATH_CONTENT.'posts'.DS); define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS); define('PATH_UPLOADS_PROFILES', PATH_UPLOADS.'profiles'.DS); +define('PATH_UPLOADS_THUMBNAILS',PATH_UPLOADS.'thumbnails'.DS); define('PATH_PAGES', PATH_CONTENT.'pages'.DS); define('PATH_DATABASES', PATH_CONTENT.'databases'.DS); define('PATH_PLUGINS_DATABASES',PATH_CONTENT.'databases'.DS.'plugins'.DS); @@ -244,9 +245,9 @@ function install($adminPassword, $email, $timezoneOffset) error_log($errorText, 0); } - if(!mkdir(PATH_PLUGINS_DATABASES.'tinymce', $dirpermissions, true)) + if(!mkdir(PATH_PLUGINS_DATABASES.'simplemde', $dirpermissions, true)) { - $errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'tinymce'; + $errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'simplemde'; error_log($errorText, 0); } @@ -268,6 +269,12 @@ function install($adminPassword, $email, $timezoneOffset) error_log($errorText, 0); } + if(!mkdir(PATH_UPLOADS_THUMBNAILS, $dirpermissions, true)) + { + $errorText = 'Error when trying to created the directory=>'.PATH_UPLOADS_THUMBNAILS; + error_log($errorText, 0); + } + // ============================================================================ // Create files // ============================================================================ @@ -409,14 +416,14 @@ function install($adminPassword, $email, $timezoneOffset) LOCK_EX ); - // File plugins/tinymce/db.php + // File plugins/simplemde/db.php file_put_contents( - PATH_PLUGINS_DATABASES.'tinymce'.DS.'db.php', + PATH_PLUGINS_DATABASES.'simplemde'.DS.'db.php', $dataHead.json_encode( array( 'position'=>0, - 'plugins'=>'autoresize, fullscreen, pagebreak, link, textcolor, code', - 'toolbar'=>'bold italic underline strikethrough | alignleft aligncenter alignright | bullist numlist | styleselect | link forecolor backcolor removeformat | pagebreak code fullscreen' + 'tabSize'=>4, + 'toolbar'=>'"bold", "italic", "heading", "|", "quote", "unordered-list", "|", "link", "image", "code", "horizontal-rule", "|", "preview", "side-by-side", "fullscreen", "guide"' ), JSON_PRETTY_PRINT), LOCK_EX diff --git a/kernel/admin/themes/default/css/default.css b/kernel/admin/themes/default/css/default.css index 3ee4bdc4..9d992f00 100644 --- a/kernel/admin/themes/default/css/default.css +++ b/kernel/admin/themes/default/css/default.css @@ -184,13 +184,21 @@ button.delete-button:hover { } -#bludit-images-v8 img.uk-thumbnail { +#bludit-images-v8 .bludit-thumbnail { + border: 1px solid #ddd; + border-radius: 4px; + box-sizing: border-box; + display: inline-block; + height: auto; + margin: 2px; + padding: 0; width: 15% !important; } #bludit-images-v8-upload { width: 100%; padding: 0; + margin-bottom: 15px !important; } #bludit-images-v8-drag-drop { @@ -203,8 +211,9 @@ button.delete-button:hover { } #bludit-images-v8-thumbnails { - height: 350px; + max-height: 350px; overflow: auto; + font-size: 0; } /* ----------- BLUDIT QUICK IMAGES ----------- */ @@ -227,7 +236,18 @@ button.delete-button:hover { } #bludit-quick-images-thumbnails { - text-align: center; + font-size: 0; +} + +#bludit-quick-images .bludit-thumbnail { + border: 1px solid #ddd; + border-radius: 4px; + box-sizing: border-box; + display: inline-block; + height: auto; + margin: 2px; + padding: 0; + width: 31% !important; } /* ----------- BLUDIT COVER IMAGE ----------- */ diff --git a/kernel/admin/themes/default/img/default.jpg b/kernel/admin/themes/default/img/default.jpg deleted file mode 100644 index 2854b89266edee31e735082b88c109370286e49f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1491 zcmex=kR1VV=P zOa>M(n}IP%zdrV6brV^ko5= z1_WTXDwrv7MYiW=Kf@-LmkpdV-u!T?`+tBzkb^;iL4lc3iGfLwky()O{}Bdxpo>@; z!2qlcNH8)nv#_$Ub8vET0~Kr)06LwSnTds&l@(+SV=Yjgfklv2NYT)dO*k--U8zvS zsBz*#4rQl}2StM}eo!$^Dr(~75)+q@lu}hw*U;25F*P%{u(Wb^admU|@bn4}2@MO6 zh>S{3Nli=7$jmA(DJ?6nsH|#kX>Duo=IO#5TBv>OAzQUCKeWE7Iu)o7@5jJ9v5U`RWxK1atvfoEEHBUYUB`cnz(S|K~81k zpbw%+MHjimR7@VKegt_9>@(s#)o$Wk0}~i9GXZ0XnHd;UEI`1@&I$tT z9PD7g0R>!OzzqVtaPS{!2qVx8pk_88;^k!Lgv$}l_UtsWj5dKE}z!NkrEoQzY{BPyOKKC5wo_ee=FzD)1 z)l%`_=e(_Vtna$M^-ft_xc%H8!up58kL{ZABW_ld+1`7(I|H4{+s%T z?y-NUJ$^*L?O*NMeX}n9-S0OmY_82r8HH);MJcB?>pe|N2%q36k$>*g-|0VIKc2n5 zYaip)I=LEwE%oB}UU_Z2ckhN(efq8F#q9-ocPFvW^4%S#Qgquh`2zEg?`vM{+TLF3 zJy$q(^Q=Sv&Ymg0eMhm+<3@4Q@_FtGUlg7cy0^?cmfUsfsk`~gs*961P5%2_b?Thy zN3-vpi(aqIF8lO{m&DazM(*J3u<5(cuDw*9o4s`7{|mpC|Kt4qaJTk*@gIwi8XsG4 zH#s#on=x^2+s`LDhcCQs&a35=JzKZJQ>IwiRcrNP9-|E>lnR!|DVhH{(sgrrPuda{%ATMa^=mV%Q{IE0Bjdf+W-In diff --git a/kernel/admin/themes/default/img/default.png b/kernel/admin/themes/default/img/default.png new file mode 100644 index 0000000000000000000000000000000000000000..f641423eff8aaa1ebfdf5ce011b9b268cc6511d5 GIT binary patch literal 2634 zcmZ`*c|4SB8y+nRIjAgQY7lW^hG8ZqV;KsOWh~7p+hB%?nPH5`(%8~xNhFlzSW_fB zV{B6q#}r{8zJ^ZtI%`#jHmU)O!z%lpS0Z)wq;C4TM1; zkUqr=k3gFq|3TlpAr*b7RDT2n5*!>14%P;fDc%q*Jv}{$CKLjNYHT7j0?(7E*bog; zpwjms|BYjc3-qKA{HX*o3B-?!^&kgPk&23Zp}(H*dE!C{e=Cs!f0VUZAcXIMXn{2$ z|Bpr`;Qxij_k5>)tLwX*K0g@3mJovT`^}U<#E}9wQ!~(p>VH%DhvV-&eN5niy|{DlYnNDaW=?RgUN~e@rP8B=N_Hg84bF)JylsM zGHGwSdX1NWU;JL7-H(z*En^j5fC{Pr3YcgR=vao)@OAUl4ojnUmHUs9=LGtbyyr*F zf`c5Fa@*pZW?z-f*wbED<=}-4OC}daqWgwnwpgbA#?-_yiiShOr-h zC@$S#RZM*LLNqQQhm${B{QD7j^P5&R=Ds1pGD-VT9f8Z+%O&HWMUf*c85j2Hce$5u zTBhHK{gl`58ZuMb$;yeqELM(Pd)?aldC-zpwLu-bd%9;nSB+>l>Lgu#Z10f8R3D>~ zGp>8oUB%5m5?M2-l5VVOJfDkv+qT?cf8{{BW2!AR$_uAR;Z}ry-toM0tjhu}^_Uq+ zz8TaMx#d^q0nq^gdO8;Ra46D!71_XU7aLuE#{6{TcSG*|q8gMtLcyPRZUmQNBjX;o zNRb*8uv6W)YUop%bkY>FbB%F*whf^rqeeVbs~hv>KA~)uyK&WKcB4xOvw{p{>1|c;P6x?7eMS zvmdgrrJRbWTWD&azl|Aptd^(w2eCysMZUc9bg7xMyg#5_w_uPnVig`%nZRW$J5|x- zy)AUx%a^vdQ1zwu6Jlla@VDsgorg>AR}SEmD{G6PgSZszE=`fS(F}(Z0j!CfC@2HQ zF}n=1FC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mB|(F~ze_H#o!1J#Ian$v3^y5$Sq$8H=nF z=LK%97-3C3O%{BZqpPuJ#|J;HrO^k{LBNO(SfO>It_;k1<%M{)9VF7|KdMh&d5;;{ ysJg@_$Js8lgnGvI!m(u>~;gUq$vjurAX%6XeVP>$5m!ZCZhHkNy)yLAZ1P literal 0 HcmV?d00001 diff --git a/kernel/admin/themes/default/init.php b/kernel/admin/themes/default/init.php index 50dbb86f..637e45b4 100644 --- a/kernel/admin/themes/default/init.php +++ b/kernel/admin/themes/default/init.php @@ -141,18 +141,44 @@ $thumbnailList = Filesystem::listFiles(PATH_UPLOADS_THUMBNAILS,'*','*',true); array_splice($thumbnailList, THUMBNAILS_AMOUNT); foreach($thumbnailList as $file) { $filename = basename($file); - $html .= 'Thumbnail'; + $html .= 'Thumbnail'; } $html .= ' +'; +if(empty($thumbnailList)) { + $html .= '
There are no images, upload someone to make Bludit more cheerful.
'; +} + +$html .= ' More images '; - echo $html; +$script = ' + +'; + + echo $html.$script; } public static function bluditCoverImage($coverImage="") @@ -190,6 +216,18 @@ $html .= ' $script = '