New Bludit Images system v8 and Cover image

This commit is contained in:
dignajar 2015-12-31 00:01:16 -03:00
parent 27dfd6cc6b
commit b4f71abd23
19 changed files with 85 additions and 57 deletions

View File

@ -41,7 +41,8 @@ legend.first-child {
padding: 15px;
}
.uk-nav-navbar > li > a:hover {
.uk-nav-navbar > li > a:hover,
.uk-nav-navbar > li > a:focus {
background: #2672ec;
}
@ -111,6 +112,10 @@ li.bludit-logo {
background: #2672ec !important;
}
.uk-placeholder {
margin-bottom: 0 !important;
}
/* ----------- BLUDIT ----------- */
#logo {
@ -167,7 +172,12 @@ button.delete-button:hover {
background: rgba(187, 48, 48, 0.91);
}
/* ----------- FORM ----------- */
.sidebar .uk-form-label {
font-size: 0.9em;
text-transform: uppercase;
}
/* ----------- BLUDIT IMAGES V8 ----------- */
#bludit-images-v8 {

BIN
kernel/admin/themes/default/css/fonts/FontAwesome.otf Normal file → Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

2
kernel/admin/themes/default/css/uikit/form-file.almost-flat.min.css vendored Normal file → Executable file
View File

@ -1,2 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-form-file{display:inline-block;vertical-align:middle;position:relative;overflow:hidden}.uk-form-file input[type=file]{position:absolute;top:0;z-index:1;width:100%;opacity:0;cursor:pointer;left:0;font-size:500px}

View File

@ -1,2 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-placeholder{margin-bottom:15px;padding:15px;border:1px dashed #ddd;background:#fafafa;color:#444}*+.uk-placeholder{margin-top:15px}.uk-placeholder>:last-child{margin-bottom:0}.uk-placeholder-large{padding-top:80px;padding-bottom:80px}

2
kernel/admin/themes/default/css/uikit/progress.almost-flat.min.css vendored Normal file → Executable file
View File

@ -1,2 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-progress{box-sizing:border-box;height:20px;margin-bottom:15px;background:#f5f5f5;overflow:hidden;line-height:20px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);border-radius:4px}*+.uk-progress{margin-top:15px}.uk-progress-bar{width:0;height:100%;background:#00a8e6;float:left;-webkit-transition:width .6s ease;transition:width .6s ease;font-size:12px;color:#fff;text-align:center;box-shadow:inset 0 0 5px rgba(0,0,0,.05);text-shadow:0 -1px 0 rgba(0,0,0,.1)}.uk-progress-mini{height:6px}.uk-progress-small{height:12px}.uk-progress-success .uk-progress-bar{background-color:#8cc14c}.uk-progress-warning .uk-progress-bar{background-color:#faa732}.uk-progress-danger .uk-progress-bar{background-color:#da314b}.uk-progress-striped .uk-progress-bar{background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:30px 30px}.uk-progress-striped.uk-active .uk-progress-bar{-webkit-animation:uk-progress-bar-stripes 2s linear infinite;animation:uk-progress-bar-stripes 2s linear infinite}@-webkit-keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}@keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}.uk-progress-mini,.uk-progress-small{border-radius:500px}

4
kernel/admin/themes/default/css/uikit/uikit.almost-flat.min.css vendored Normal file → Executable file

File diff suppressed because one or more lines are too long

2
kernel/admin/themes/default/css/uikit/upload.almost-flat.min.css vendored Normal file → Executable file
View File

@ -1,2 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-dragover{box-shadow:0 0 20px rgba(100,100,100,.3)}

View File

@ -134,8 +134,6 @@ class HTML {
$html = '<!-- BLUDIT QUICK IMAGES -->';
$html .= '
<div id="bludit-quick-images">
<h4 class="label">Images</h4>
<div id="bludit-quick-images-thumbnails">
';

6
kernel/admin/themes/default/js/uikit/uikit.min.js vendored Normal file → Executable file

File diff suppressed because one or more lines are too long

2
kernel/admin/themes/default/js/uikit/upload.min.js vendored Normal file → Executable file
View File

@ -1,2 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
!function(e){var t;window.UIkit&&(t=e(UIkit)),"function"==typeof define&&define.amd&&define("uikit-upload",["uikit"],function(){return t||e(UIkit)})}(function(e){"use strict";function t(o,a){function r(t,n){var o=new FormData,a=new XMLHttpRequest;if(n.before(n,t)!==!1){for(var r,i=0;r=t[i];i++)o.append(n.param,r);for(var l in n.params)o.append(l,n.params[l]);a.upload.addEventListener("progress",function(e){var t=e.loaded/e.total*100;n.progress(t,e)},!1),a.addEventListener("loadstart",function(e){n.loadstart(e)},!1),a.addEventListener("load",function(e){n.load(e)},!1),a.addEventListener("loadend",function(e){n.loadend(e)},!1),a.addEventListener("error",function(e){n.error(e)},!1),a.addEventListener("abort",function(e){n.abort(e)},!1),a.open(n.method,n.action,!0),"json"==n.type&&a.setRequestHeader("Accept","application/json"),a.onreadystatechange=function(){if(n.readystatechange(a),4==a.readyState){var t=a.responseText;if("json"==n.type)try{t=e.$.parseJSON(t)}catch(o){t=!1}n.complete(t,a)}},n.beforeSend(a),a.send(o)}}if(!e.support.ajaxupload)return this;if(a=e.$.extend({},t.defaults,a),o.length){if("*.*"!==a.allow)for(var i,l=0;i=o[l];l++)if(!n(a.allow,i.name))return"string"==typeof a.notallowed?alert(a.notallowed):a.notallowed(i,a),void 0;var s=a.complete;if(a.single){var d=o.length,f=0,p=!0;a.beforeAll(o),a.complete=function(e,t){f+=1,s(e,t),a.filelimit&&f>=a.filelimit&&(p=!1),p&&d>f?r([o[f]],a):a.allcomplete(e,t)},r([o[0]],a)}else a.complete=function(e,t){s(e,t),a.allcomplete(e,t)},r(o,a)}}function n(e,t){var n="^"+e.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")+"$";return n="^"+n+"$",null!==t.match(new RegExp(n,"i"))}return e.component("uploadSelect",{init:function(){var e=this;this.on("change",function(){t(e.element[0].files,e.options);var n=e.element.clone(!0).data("uploadSelect",e);e.element.replaceWith(n),e.element=n})}}),e.component("uploadDrop",{defaults:{dragoverClass:"uk-dragover"},init:function(){var e=this,n=!1;this.on("drop",function(n){n.dataTransfer&&n.dataTransfer.files&&(n.stopPropagation(),n.preventDefault(),e.element.removeClass(e.options.dragoverClass),e.element.trigger("dropped.uk.upload",[n.dataTransfer.files]),t(n.dataTransfer.files,e.options))}).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}).on("dragover",function(t){t.stopPropagation(),t.preventDefault(),n||(e.element.addClass(e.options.dragoverClass),n=!0)}).on("dragleave",function(t){t.stopPropagation(),t.preventDefault(),e.element.removeClass(e.options.dragoverClass),n=!1})}}),e.support.ajaxupload=function(){function e(){var e=document.createElement("INPUT");return e.type="file","files"in e}function t(){var e=new XMLHttpRequest;return!!(e&&"upload"in e&&"onprogress"in e.upload)}function n(){return!!window.FormData}return e()&&t()&&n()}(),e.support.ajaxupload&&e.$.event.props.push("dataTransfer"),t.defaults={action:"",single:!0,method:"POST",param:"files[]",params:{},allow:"*.*",type:"text",filelimit:!1,before:function(){},beforeSend:function(){},beforeAll:function(){},loadstart:function(){},load:function(){},loadend:function(){},error:function(){},abort:function(){},progress:function(){},complete:function(){},allcomplete:function(){},readystatechange:function(){},notallowed:function(e,t){alert("Only the following file types are allowed: "+t.allow)}},e.Utils.xhrupload=t,t});

View File

@ -91,7 +91,9 @@ echo '<div class="sidebar uk-width-large-2-10">';
echo '<li>';
// --- BLUDIT COVER IMAGE ---
HTML::bluditCoverImage($_Page->coverImage());
echo '<hr>';
HTML::bluditCoverImage($_Page->coverImage(false));
echo '<hr>';
// --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages();
@ -104,6 +106,16 @@ echo '<div class="sidebar uk-width-large-2-10">';
// ---- ADVANCED TAB ----
echo '<li>';
// Status input
HTML::formSelect(array(
'name'=>'status',
'label'=>$L->g('Status'),
'class'=>'uk-width-1-1 uk-form-medium',
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
'selected'=>($_Page->draft()?'draft':'published'),
'tip'=>''
));
// If the page is parent then doesn't can have a parent.
if(count($_Page->children())===0)
{
@ -123,16 +135,6 @@ if(count($_Page->children())===0)
));
}
// Status input
HTML::formSelect(array(
'name'=>'status',
'label'=>$L->g('Status'),
'class'=>'uk-width-1-1 uk-form-medium',
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
'selected'=>($_Page->draft()?'draft':'published'),
'tip'=>''
));
// Position input
HTML::formInputText(array(
'name'=>'position',

View File

@ -85,7 +85,9 @@ echo '<div class="sidebar uk-width-large-2-10">';
echo '<li>';
// --- BLUDIT COVER IMAGE ---
HTML::bluditCoverImage($_Post->coverImage());
echo '<hr>';
HTML::bluditCoverImage($_Post->coverImage(false));
echo '<hr>';
// --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages();
@ -98,15 +100,6 @@ echo '<div class="sidebar uk-width-large-2-10">';
// ---- ADVANCED TAB ----
echo '<li>';
// Date input
HTML::formInputText(array(
'name'=>'date',
'value'=>$_Post->dateRaw(),
'class'=>'uk-width-1-1 uk-form-large',
'tip'=>$L->g('To schedule the post just select the date and time'),
'label'=>$L->g('Date')
));
// Status input
HTML::formSelect(array(
'name'=>'status',
@ -117,6 +110,15 @@ echo '<div class="sidebar uk-width-large-2-10">';
'tip'=>''
));
// Date input
HTML::formInputText(array(
'name'=>'date',
'value'=>$_Post->dateRaw(),
'class'=>'uk-width-1-1 uk-form-large',
'tip'=>$L->g('To schedule the post just select the date and time'),
'label'=>$L->g('Date')
));
// Slug input
HTML::formInputText(array(
'name'=>'slug',

View File

@ -78,7 +78,9 @@ echo '<div class="sidebar uk-width-large-2-10">';
echo '<li>';
// --- BLUDIT COVER IMAGE ---
echo '<hr>';
HTML::bluditCoverImage();
echo '<hr>';
// --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages();
@ -91,6 +93,16 @@ echo '<div class="sidebar uk-width-large-2-10">';
// ---- ADVANCED TAB ----
echo '<li>';
// Status input
HTML::formSelect(array(
'name'=>'status',
'label'=>$L->g('Status'),
'class'=>'uk-width-1-1 uk-form-medium',
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
'selected'=>'published',
'tip'=>''
));
// Parent input
$options = array();
$options[NO_PARENT_CHAR] = '('.$Language->g('No parent').')';
@ -105,16 +117,6 @@ echo '<div class="sidebar uk-width-large-2-10">';
'tip'=>''
));
// Status input
HTML::formSelect(array(
'name'=>'status',
'label'=>$L->g('Status'),
'class'=>'uk-width-1-1 uk-form-medium',
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
'selected'=>'published',
'tip'=>''
));
// Position input
HTML::formInputText(array(
'name'=>'position',

View File

@ -78,7 +78,9 @@ echo '<div class="sidebar uk-width-large-2-10">';
echo '<li>';
// --- BLUDIT COVER IMAGE ---
echo '<hr>';
HTML::bluditCoverImage();
echo '<hr>';
// --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages();
@ -91,15 +93,6 @@ echo '<div class="sidebar uk-width-large-2-10">';
// ---- ADVANCED TAB ----
echo '<li>';
// Date input
HTML::formInputText(array(
'name'=>'date',
'value'=>Date::current(DB_DATE_FORMAT),
'class'=>'uk-width-1-1 uk-form-large',
'tip'=>$L->g('To schedule the post just select the date and time'),
'label'=>$L->g('Date')
));
// Status input
HTML::formSelect(array(
'name'=>'status',
@ -110,6 +103,15 @@ echo '<div class="sidebar uk-width-large-2-10">';
'tip'=>''
));
// Date input
HTML::formInputText(array(
'name'=>'date',
'value'=>Date::current(DB_DATE_FORMAT),
'class'=>'uk-width-1-1 uk-form-large',
'tip'=>$L->g('To schedule the post just select the date and time'),
'label'=>$L->g('Date')
));
// Slug input
HTML::formInputText(array(
'name'=>'slug',

View File

@ -111,9 +111,15 @@ class Page extends fileContent
return $this->getField('key');
}
public function coverImage()
public function coverImage($absolute=true)
{
return $this->getField('coverImage');
$fileName = $this->getField('coverImage');
if($absolute) {
return HTML_PATH_UPLOADS.$fileName;
}
return $fileName;
}
// Returns TRUE if the page is published, FALSE otherwise.

View File

@ -83,9 +83,15 @@ class Post extends fileContent
return $this->getField('username');
}
public function coverImage()
public function coverImage($absolute=true)
{
return $this->getField('coverImage');
$fileName = $this->getField('coverImage');
if($absolute) {
return HTML_PATH_UPLOADS.$fileName;
}
return $fileName;
}
public function profilePicture()