Merge branch 'bludit:v4.0' into v4.0
This commit is contained in:
commit
e14e2eae02
4 changed files with 21 additions and 14 deletions
|
@ -1,5 +1,5 @@
|
||||||
<div aria-live="polite" aria-atomic="true" class="position-relative">
|
<div aria-live="polite" aria-atomic="true" class="position-relative z-index-master">
|
||||||
<div class="toast-container position-absolute start-50 translate-middle-x mt-3" style="z-index:1050;">
|
<div class="toast-container position-absolute start-50 translate-middle-x mt-3" style="z-index:1100;">
|
||||||
<div id="alert" class="toast text-center text-white border-0 p-3" role="alert" aria-live="assertive" aria-atomic="true">
|
<div id="alert" class="toast text-center text-white border-0 p-3" role="alert" aria-live="assertive" aria-atomic="true">
|
||||||
Hello, I'm a Bludit alert!
|
Hello, I'm a Bludit alert!
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -120,16 +120,22 @@
|
||||||
'<td class="align-middle">' + formatBytes(file.size) + '</td>' +
|
'<td class="align-middle">' + formatBytes(file.size) + '</td>' +
|
||||||
'<td class="align-middle text-center">' +
|
'<td class="align-middle text-center">' +
|
||||||
'<div class="dropdown">' +
|
'<div class="dropdown">' +
|
||||||
' <button class="btn btn-sm btn-secondary dropdown-toggle" type="button" id="fileOptions" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-gear"></i><?php $L->p('Options') ?></button>' +
|
'<button class="btn btn-sm btn-secondary dropdown-toggle" type="button" id="fileOptions" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-gear"></i><?php $L->p('Options') ?></button>' +
|
||||||
' <ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="fileOptions">' +
|
'<ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="fileOptions">';
|
||||||
' <li><a class="dropdown-item" href="#" onClick="fmInsertFile(\'' + file.filename + '\', \'' + file.absoluteURL + '\', \'' + file.mime + '\'); fmClose();"><i class="bi bi-plus-circle"></i><?php $L->p('Insert original') ?></a></li>' +
|
|
||||||
' <li><a class="dropdown-item" href="#" onClick="fmInsertFile(\'' + file.filename + '\', \'' + file.thumbnailSmall + '\', \'' + file.mime + '\'); fmClose();"><i class="bi bi-plus-circle"></i><?php $L->p('Insert small') ?></a></li>' +
|
if (ALLOWED_IMG_MIMETYPES.includes(file.mime)) {
|
||||||
' <li><a class="dropdown-item" href="#" onClick="fmInsertFile(\'' + file.filename + '\', \'' + file.thumbnailMedium + '\', \'' + file.mime + '\'); fmClose();"><i class="bi bi-plus-circle"></i><?php $L->p('Insert medium') ?></a></li>' +
|
row += '<li><a class="dropdown-item" href="#" onClick="fmInsertFile(\'' + file.filename + '\', \'' + file.absoluteURL + '\', \'' + file.mime + '\'); fmClose();"><i class="bi bi-plus-circle"></i><?php $L->p('Insert original') ?></a></li>' +
|
||||||
' <li><hr class="dropdown-divider"></li>' +
|
'<li><a class="dropdown-item" href="#" onClick="fmInsertFile(\'' + file.filename + '\', \'' + file.thumbnailSmall + '\', \'' + file.mime + '\'); fmClose();"><i class="bi bi-plus-circle"></i><?php $L->p('Insert small') ?></a></li>' +
|
||||||
' <li><a class="dropdown-item" href="#" onClick="setCoverImage(\'' + file.filename + '\')"><i class="bi bi-image"></i><?php $L->p('Set as cover image') ?></a></li>' +
|
'<li><a class="dropdown-item" href="#" onClick="fmInsertFile(\'' + file.filename + '\', \'' + file.thumbnailMedium + '\', \'' + file.mime + '\'); fmClose();"><i class="bi bi-plus-circle"></i><?php $L->p('Insert medium') ?></a></li>' +
|
||||||
' <li><hr class="dropdown-divider"></li>' +
|
'<li><hr class="dropdown-divider"></li>' +
|
||||||
' <li><a class="dropdown-item" href="#"><i class="bi bi-trash"></i><?php $L->p('Delete') ?></a></li>' +
|
'<li><a class="dropdown-item" href="#" onClick="setCoverImage(\'' + file.filename + '\')"><i class="bi bi-image"></i><?php $L->p('Set as cover image') ?></a></li>';
|
||||||
' </ul>' +
|
} else {
|
||||||
|
row += '<li><a class="dropdown-item" href="#" onClick="fmInsertFile(\'' + file.filename + '\', \'' + file.absoluteURL + '\', \'' + file.mime + '\'); fmClose();"><i class="bi bi-plus-circle"></i><?php $L->p('Insert') ?></a></li>';
|
||||||
|
}
|
||||||
|
|
||||||
|
row += '<li><hr class="dropdown-divider"></li>' +
|
||||||
|
'<li><a class="dropdown-item" href="#"><i class="bi bi-trash"></i><?php $L->p('Delete') ?></a></li>' +
|
||||||
|
'</ul>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</td>' +
|
'</td>' +
|
||||||
'</tr>';
|
'</tr>';
|
||||||
|
|
|
@ -113,7 +113,7 @@ $GLOBALS['ALLOWED_IMG_EXTENSIONS'] = array('gif', 'png', 'jpg', 'jpeg', 'svg');
|
||||||
$GLOBALS['ALLOWED_IMG_MIMETYPES'] = array('image/gif', 'image/png', 'image/jpeg', 'image/svg+xml');
|
$GLOBALS['ALLOWED_IMG_MIMETYPES'] = array('image/gif', 'image/png', 'image/jpeg', 'image/svg+xml');
|
||||||
|
|
||||||
// Allowed files extensions
|
// Allowed files extensions
|
||||||
$GLOBALS['ALLOWED_FILE_EXTENSIONS'] = array('gif', 'png', 'jpg', 'jpeg', 'svg', 'pdf');
|
$GLOBALS['ALLOWED_FILE_EXTENSIONS'] = array_merge($GLOBALS['ALLOWED_IMG_EXTENSIONS'], array('pdf'));
|
||||||
|
|
||||||
// Allowed files mime types
|
// Allowed files mime types
|
||||||
$GLOBALS['ALLOWED_FILE_MIMETYPES'] = array('image/gif', 'image/png', 'image/jpeg', 'image/svg+xml', 'application/pdf');
|
$GLOBALS['ALLOWED_FILE_MIMETYPES'] = array_merge($GLOBALS['ALLOWED_IMG_MIMETYPES'], array('application/pdf'));
|
||||||
|
|
|
@ -23,6 +23,7 @@ echo 'var DB_DATE_FORMAT = "'.DB_DATE_FORMAT.'";'.PHP_EOL;
|
||||||
echo 'var AUTOSAVE_INTERVAL = "'.AUTOSAVE_INTERVAL.'";'.PHP_EOL;
|
echo 'var AUTOSAVE_INTERVAL = "'.AUTOSAVE_INTERVAL.'";'.PHP_EOL;
|
||||||
echo 'var PAGE_BREAK = "'.PAGE_BREAK.'";'.PHP_EOL;
|
echo 'var PAGE_BREAK = "'.PAGE_BREAK.'";'.PHP_EOL;
|
||||||
echo 'var tokenCSRF = "'.$security->getTokenCSRF().'";'.PHP_EOL;
|
echo 'var tokenCSRF = "'.$security->getTokenCSRF().'";'.PHP_EOL;
|
||||||
|
echo 'var ALLOWED_IMG_MIMETYPES = '.json_encode($GLOBALS['ALLOWED_IMG_MIMETYPES']).';'.PHP_EOL;
|
||||||
echo 'var ALLOWED_FILE_MIMETYPES = '.json_encode($GLOBALS['ALLOWED_FILE_MIMETYPES']).';'.PHP_EOL;
|
echo 'var ALLOWED_FILE_MIMETYPES = '.json_encode($GLOBALS['ALLOWED_FILE_MIMETYPES']).';'.PHP_EOL;
|
||||||
echo 'var UPLOAD_MAX_FILESIZE = '.Text::toBytes( ini_get('upload_max_filesize') ).';'.PHP_EOL;
|
echo 'var UPLOAD_MAX_FILESIZE = '.Text::toBytes( ini_get('upload_max_filesize') ).';'.PHP_EOL;
|
||||||
echo 'var DEBUG_MODE = '.(DEBUG_MODE?'true':'false').';'.PHP_EOL;
|
echo 'var DEBUG_MODE = '.(DEBUG_MODE?'true':'false').';'.PHP_EOL;
|
||||||
|
|
Loading…
Reference in a new issue