Dashboard, plugins and themes compatibility

This commit is contained in:
dignajar 2016-08-09 20:46:56 -03:00
parent 6f9064046a
commit a79de17b24
13 changed files with 91 additions and 297 deletions

View File

@ -10,23 +10,6 @@
width: 80% !important; width: 80% !important;
} }
#bl-sidebar .uk-nav-header {
font-weight: normal !important;
font-size: 16px;
}
#bl-sidebar .uk-nav {
margin: 0px 0 0 20px !important;
}
#bl-sidebar .bl-icon {
margin-right: 5px;
}
#bl-sidebar a {
color: #777 !important;
}
/* UIKIT HACKs buttons /* UIKIT HACKs buttons
---------------------------------------------------------------- */ ---------------------------------------------------------------- */
@ -39,17 +22,59 @@ body {
overflow-y: scroll; overflow-y: scroll;
} }
/* TOPBAR
---------------------------------------------------------------- */
#bl-navbar { #bl-navbar {
background: #f1f1f1; background: #f1f1f1;
margin-bottom: 20px; margin-bottom: 20px;
width: 100%; width: 100%;
} }
#bl-navbar .bl-brand { #bl-navbar a.bl-brand {
font-size: 20px; font-size: 20px;
line-height: 60px; line-height: 60px;
margin: 0 30px; margin: 0 0 0 35px;
text-transform: uppercase; text-transform: uppercase;
text-shadow: 0 1px 0 #fff;
}
#bl-navbar a.bl-brand:hover {
text-decoration: none;
}
/* SIDEBAR
---------------------------------------------------------------- */
#bl-sidebar a {
color: #777 !important;
}
#bl-sidebar .uk-nav {
margin: 0px 0 0 20px !important;
}
#bl-sidebar .uk-nav-header {
font-weight: normal !important;
font-size: 16px;
}
/* VIEW
---------------------------------------------------------------- */
#bl-view {
margin-right: 20px;
}
.plugin-incompatible,
.theme-incompatible {
background: #ffdc7d;
border: 1px dashed #eec24a;
color: #826106;
display: table-cell;
font-size: 12px;
margin-top: 6px;
padding: 1px 10px;
} }
/* OLD /* OLD

View File

@ -1,2 +1,2 @@
/*! UIkit 2.26.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ /*! UIkit 2.26.4 | 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} .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.26.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ /*! UIkit 2.26.4 | 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} .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}

View File

@ -1,2 +1,2 @@
/*! UIkit 2.26.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ /*! UIkit 2.26.4 | 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} .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
bl-kernel/admin/themes/default2/css/uikit/uikit.almost-flat.min.css vendored Normal file → Executable file

File diff suppressed because one or more lines are too long

View File

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

View File

@ -82,7 +82,9 @@ $(document).ready(function() {
<div class="uk-grid uk-grid-small"> <div class="uk-grid uk-grid-small">
<div id="bl-sidebar" class="uk-width-1-4"> <div class="uk-width-1-4">
<div id="bl-sidebar">
<ul class="uk-nav"> <ul class="uk-nav">
<li <?php echo ($layout['view']=='dashboard')?'class="uk-active"':'' ?>> <li <?php echo ($layout['view']=='dashboard')?'class="uk-active"':'' ?>>
@ -129,15 +131,19 @@ $(document).ready(function() {
</li> </li>
</ul> </ul>
</div>
</div> </div>
<div class="uk-width-3-4"> <div class="uk-width-3-4">
<div id="bl-view">
<?php <?php
if( Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php') ) { if( Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php') ) {
include(PATH_ADMIN_VIEWS.$layout['view'].'.php'); include(PATH_ADMIN_VIEWS.$layout['view'].'.php');
} }
?> ?>
</div> </div>
</div>
</div> </div>

6
bl-kernel/admin/themes/default2/js/uikit/uikit.min.js vendored Normal file → Executable file

File diff suppressed because one or more lines are too long

258
bl-kernel/admin/themes/default2/js/uikit/upload.min.js vendored Normal file → Executable file
View File

@ -1,256 +1,2 @@
(function(addon) { /*! UIkit 2.26.4 | 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 f=a.complete;if(a.single){var s=o.length,d=0,p=!0;a.beforeAll(o),a.complete=function(e,t){d+=1,f(e,t),a.filelimit&&d>=a.filelimit&&(p=!1),p&&s>d?r([o[d]],a):a.allcomplete(e,t)},r([o[0]],a)}else a.complete=function(e,t){f(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.originalEvent.dataTransfer&&n.originalEvent.dataTransfer.files&&(n.stopPropagation(),n.preventDefault(),e.element.removeClass(e.options.dragoverClass),e.element.trigger("dropped.uk.upload",[n.originalEvent.dataTransfer.files]),t(n.originalEvent.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()}(),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});
var component;
if (window.UIkit) {
component = addon(UIkit);
}
if (typeof define == "function" && define.amd) {
define("uikit-upload", ["uikit"], function(){
return component || addon(UIkit);
});
}
})(function(UI){
"use strict";
UI.component('uploadSelect', {
init: function() {
var $this = this;
this.on("change", function() {
xhrupload($this.element[0].files, $this.options);
var twin = $this.element.clone(true).data('uploadSelect', $this);
$this.element.replaceWith(twin);
$this.element = twin;
});
}
});
UI.component('uploadDrop', {
defaults: {
'dragoverClass': 'uk-dragover'
},
init: function() {
var $this = this, hasdragCls = false;
this.on("drop", function(e){
if (e.originalEvent.dataTransfer && e.originalEvent.dataTransfer.files) {
e.stopPropagation();
e.preventDefault();
$this.element.removeClass($this.options.dragoverClass);
$this.element.trigger('dropped.uk.upload', [e.originalEvent.dataTransfer.files]);
xhrupload(e.originalEvent.dataTransfer.files, $this.options);
}
}).on("dragenter", function(e){
e.stopPropagation();
e.preventDefault();
}).on("dragover", function(e){
e.stopPropagation();
e.preventDefault();
if (!hasdragCls) {
$this.element.addClass($this.options.dragoverClass);
hasdragCls = true;
}
}).on("dragleave", function(e){
e.stopPropagation();
e.preventDefault();
$this.element.removeClass($this.options.dragoverClass);
hasdragCls = false;
});
}
});
UI.support.ajaxupload = (function() {
function supportFileAPI() {
var fi = document.createElement('INPUT'); fi.type = 'file'; return 'files' in fi;
}
function supportAjaxUploadProgressEvents() {
var xhr = new XMLHttpRequest(); return !! (xhr && ('upload' in xhr) && ('onprogress' in xhr.upload));
}
function supportFormData() {
return !! window.FormData;
}
return supportFileAPI() && supportAjaxUploadProgressEvents() && supportFormData();
})();
function xhrupload(files, settings) {
if (!UI.support.ajaxupload){
return this;
}
settings = UI.$.extend({}, xhrupload.defaults, settings);
if (!files.length){
return;
}
if (settings.allow !== '*.*') {
for(var i=0,file;file=files[i];i++) {
if(!matchName(settings.allow, file.name)) {
if(typeof(settings.notallowed) == 'string') {
alert(settings.notallowed);
} else {
settings.notallowed(file, settings);
}
return;
}
}
}
var complete = settings.complete;
if (settings.single){
var count = files.length,
uploaded = 0,
allow = true;
settings.beforeAll(files);
settings.complete = function(response, xhr){
uploaded = uploaded + 1;
complete(response, xhr);
if (settings.filelimit && uploaded >= settings.filelimit){
allow = false;
}
if (allow && uploaded<count){
upload([files[uploaded]], settings);
} else {
settings.allcomplete(response, xhr);
}
};
upload([files[0]], settings);
} else {
settings.complete = function(response, xhr){
complete(response, xhr);
settings.allcomplete(response, xhr);
};
upload(files, settings);
}
function upload(files, settings){
// upload all at once
var formData = new FormData(), xhr = new XMLHttpRequest();
if (settings.before(settings, files)===false) return;
for (var i = 0, f; f = files[i]; i++) { formData.append(settings.param, f); }
for (var p in settings.params) { formData.append(p, settings.params[p]); }
// Add any event handlers here...
xhr.upload.addEventListener("progress", function(e){
var percent = (e.loaded / e.total)*100;
settings.progress(percent, e);
}, false);
xhr.addEventListener("loadstart", function(e){ settings.loadstart(e); }, false);
xhr.addEventListener("load", function(e){ settings.load(e); }, false);
xhr.addEventListener("loadend", function(e){ settings.loadend(e); }, false);
xhr.addEventListener("error", function(e){ settings.error(e); }, false);
xhr.addEventListener("abort", function(e){ settings.abort(e); }, false);
xhr.open(settings.method, settings.action, true);
if (settings.type=="json") {
xhr.setRequestHeader("Accept", "application/json");
}
xhr.onreadystatechange = function() {
settings.readystatechange(xhr);
if (xhr.readyState==4){
var response = xhr.responseText;
if (settings.type=="json") {
try {
response = UI.$.parseJSON(response);
} catch(e) {
response = false;
}
}
settings.complete(response, xhr);
}
};
settings.beforeSend(xhr);
xhr.send(formData);
}
}
xhrupload.defaults = {
'action': '',
'single': true,
'method': 'POST',
'param' : 'files[]',
'params': {},
'allow' : '*.*',
'type' : 'text',
'filelimit': false,
// events
'before' : function(o){},
'beforeSend' : function(xhr){},
'beforeAll' : function(){},
'loadstart' : function(){},
'load' : function(){},
'loadend' : function(){},
'error' : function(){},
'abort' : function(){},
'progress' : function(){},
'complete' : function(){},
'allcomplete' : function(){},
'readystatechange': function(){},
'notallowed' : function(file, settings){ alert('Only the following file types are allowed: '+settings.allow); }
};
function matchName(pattern, path) {
var parsedPattern = '^' + pattern.replace(/\//g, '\\/').
replace(/\*\*/g, '(\\/[^\\/]+)*').
replace(/\*/g, '[^\\/]+').
replace(/((?!\\))\?/g, '$1.') + '$';
parsedPattern = '^' + parsedPattern + '$';
return (path.match(new RegExp(parsedPattern, 'i')) !== null);
}
UI.Utils.xhrupload = xhrupload;
return xhrupload;
});

View File

@ -35,10 +35,20 @@ foreach($plugins['all'] as $Plugin)
echo '<a class="install" href="'.HTML_PATH_ADMIN_ROOT.'install-plugin/'.$Plugin->className().'">'.$L->g('Activate').'</a>'; echo '<a class="install" href="'.HTML_PATH_ADMIN_ROOT.'install-plugin/'.$Plugin->className().'">'.$L->g('Activate').'</a>';
} }
echo ' echo '
</div> </div>
</td> </td>';
<td>'.$Plugin->description().'</td>
echo '<td>';
echo $Plugin->description();
if( !$Plugin->isCompatible() ) {
echo '<div class="plugin-incompatible">This plugin is incompatible with Bludit v'.BLUDIT_VERSION.'</div>';
}
echo '</td>';
echo '
<td class="uk-text-center">'.$Plugin->version().'</td> <td class="uk-text-center">'.$Plugin->version().'</td>
<td class="uk-text-center"><a targe="_blank" href="'.$Plugin->website().'">'.$Plugin->author().'</a></td> <td class="uk-text-center"><a targe="_blank" href="'.$Plugin->website().'">'.$Plugin->author().'</a></td>
'; ';

View File

@ -30,8 +30,17 @@ foreach($themes as $theme)
echo ' echo '
</div> </div>
</td> </td>';
<td>'.$theme['description'].'</td>
echo '<td>';
echo $theme['description'];
if( !$theme['compatible'] ) {
echo '<div class="theme-incompatible">This theme is incompatible with Bludit v'.BLUDIT_VERSION.'</div>';
}
echo '</td>';
echo '
<td class="uk-text-center">'.$theme['version'].'</td> <td class="uk-text-center">'.$theme['version'].'</td>
<td class="uk-text-center"><a targe="_blank" href="'.$theme['website'].'">'.$theme['author'].'</a></td> <td class="uk-text-center"><a targe="_blank" href="'.$theme['website'].'">'.$theme['author'].'</a></td>
'; ';

View File

@ -44,21 +44,19 @@ function buildThemes()
$metadataString = file_get_contents($filenameMetadata); $metadataString = file_get_contents($filenameMetadata);
$metadata = json_decode($metadataString, true); $metadata = json_decode($metadataString, true);
$database['compatible'] = false;
if( !empty($metadata['compatible']) ) { if( !empty($metadata['compatible']) ) {
$explode = explode(',', $metadata['compatible']); $explode = explode(',', $metadata['compatible']);
if(in_array(BLUDIT_VERSION, $explode)) { if(in_array(BLUDIT_VERSION, $explode)) {
$database['compatible'] = true;
}
}
$database = $database + $metadata; $database = $database + $metadata;
array_push($themes, $database); array_push($themes, $database);
} }
} }
else {
Log::set('99.themes.php'.LOG_SEP.'Metadata file error on theme '.$themePath);
}
}
}
} }
return $themes; return $themes;

View File

@ -5,6 +5,6 @@
"version": "1.4", "version": "1.4",
"releaseDate": "2016-05-20", "releaseDate": "2016-05-20",
"license": "CCA 3.0", "license": "CCA 3.0",
"compatible": "1.5beta", "compatible": "1.4",
"notes": "" "notes": ""
} }