mirror of
https://github.com/typemill/typemill.git
synced 2025-04-21 04:21:56 +02:00
Version 1.3.4: Media Library
This commit is contained in:
parent
aa52181849
commit
d41fe5c95d
BIN
media/markdown.png
Normal file
BIN
media/markdown.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
@ -60,9 +60,9 @@ class ProcessAssets
|
||||
|
||||
foreach($folders as $folder)
|
||||
{
|
||||
if(!file_exists($folder))
|
||||
if(!file_exists($folder) && !is_dir( $folder ))
|
||||
{
|
||||
if(!mkdir($folder, 0774, true))
|
||||
if(!mkdir($folder, 0755, true))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -75,14 +75,29 @@ class ProcessAssets
|
||||
$this->generateThumbs();
|
||||
}
|
||||
}
|
||||
elseif(!is_writeable($folder))
|
||||
elseif(!is_writeable($folder) OR !is_readable($folder))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
# check if thumb-folder is empty, then generate thumbs from live folder
|
||||
if($folder == $this->thumbFolder && $this->is_dir_empty($folder))
|
||||
{
|
||||
# cleanup old systems
|
||||
$this->cleanupLiveFolder();
|
||||
|
||||
# generate thumbnails from live folder
|
||||
$this->generateThumbs();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function is_dir_empty($dir)
|
||||
{
|
||||
return (count(scandir($dir)) == 2);
|
||||
}
|
||||
|
||||
public function setFileName($originalname, $type, $overwrite = null)
|
||||
{
|
||||
$pathinfo = pathinfo($originalname);
|
||||
|
@ -329,9 +329,10 @@ class ProcessImage extends ProcessAssets
|
||||
{
|
||||
if (!in_array($name, array(".","..")))
|
||||
{
|
||||
$this->generateThumbFromImageFile($name);
|
||||
$result = $this->generateThumbFromImageFile($name);
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function generateThumbFromImageFile($filename)
|
||||
@ -354,7 +355,12 @@ class ProcessImage extends ProcessAssets
|
||||
|
||||
$thumb = $this->imageResize($image, $originalSize, ['thumbs' => $thumbSize ], $this->extension);
|
||||
|
||||
$this->saveImage($this->thumbFolder, $thumb['thumbs'], $this->filename, $this->extension);
|
||||
$saveImage = $this->saveImage($this->thumbFolder, $thumb['thumbs'], $this->filename, $this->extension);
|
||||
if($saveImage)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function generateSizesFromImageFile($filename, $image)
|
||||
|
@ -16,6 +16,9 @@ class Settings
|
||||
$settings = array_merge($defaultSettings, $userSettings);
|
||||
}
|
||||
|
||||
# no individual image sizes are allowed sind 1.3.4
|
||||
$settings['images'] = $defaultSettings['images'];
|
||||
|
||||
# if there is no theme set
|
||||
if(!isset($settings['theme']))
|
||||
{
|
||||
@ -78,7 +81,7 @@ class Settings
|
||||
'contentFolder' => 'content',
|
||||
'cache' => true,
|
||||
'cachePath' => $rootPath . 'cache',
|
||||
'version' => '1.3.3',
|
||||
'version' => '1.3.4',
|
||||
'setup' => true,
|
||||
'welcome' => true,
|
||||
'images' => ['live' => ['width' => 820], 'thumbs' => ['width' => 250, 'height' => 150]],
|
||||
|
@ -1727,6 +1727,7 @@ label .help, .label .help{
|
||||
}
|
||||
.blox-editor input.mdcontent.h2,.blox-editor input.mdcontent.h3,.blox-editor input.mdcontent.h4,.blox-editor input.mdcontent.h5,.blox-editor input.mdcontent.h6{
|
||||
padding-left: 35px;
|
||||
height: auto;
|
||||
}
|
||||
.blox-editor input.mdcontent.h2{
|
||||
font-size: 1.6em;
|
||||
@ -1973,7 +1974,8 @@ button.format-item.close:hover{
|
||||
************************/
|
||||
|
||||
/* format menu */
|
||||
.inlineFormatBar {
|
||||
.inlineFormatBar {
|
||||
box-sizing:content-box;
|
||||
height: 30px;
|
||||
padding: 5px 10px;
|
||||
background: #333;
|
||||
@ -2403,10 +2405,12 @@ hr{
|
||||
}
|
||||
.blox li.h1{
|
||||
font-weight: 700;
|
||||
height:auto;
|
||||
}
|
||||
.blox li.h2,.blox li.h3,.blox li.h4,.blox li.h5,.blox li.h6{
|
||||
font-weight: 400;
|
||||
padding-left: 25px;
|
||||
height:auto;
|
||||
}
|
||||
.blox a, .blox a:link, .blox a:visited,
|
||||
footer a, footer a:link, footer a:visited
|
||||
|
@ -17,8 +17,8 @@
|
||||
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ base_url }}/system/author/img/apple-touch-icon-152x152.png" />
|
||||
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/tachyons.min.css?20200226" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200226" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/tachyons.min.css?20200405" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200405" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
|
||||
</head>
|
||||
<body>
|
||||
@ -56,7 +56,7 @@
|
||||
</article>
|
||||
<footer></footer>
|
||||
</div>
|
||||
<script src="{{ base_url }}/system/author/js/color-picker.min.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/author.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/color-picker.min.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/author.js?20200405"></script>
|
||||
</body>
|
||||
</html>
|
@ -18,7 +18,7 @@
|
||||
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ base_url }}/system/author/img/apple-touch-icon-152x152.png" />
|
||||
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200226" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200405" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
|
||||
</head>
|
||||
<body>
|
||||
@ -54,6 +54,6 @@
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
</div>
|
||||
<script src="{{ base_url }}/system/author/js/auth.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/auth.js?20200405"></script>
|
||||
</body>
|
||||
</html>
|
@ -17,7 +17,7 @@
|
||||
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ base_url }}/system/author/img/apple-touch-icon-152x152.png" />
|
||||
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200226" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200405" />
|
||||
</head>
|
||||
<body>
|
||||
<svg style="position: absolute; width: 0; height: 0; overflow: hidden" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/tachyons.min.css" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200226" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200405" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
|
||||
|
||||
{{ assets.renderCSS() }}
|
||||
@ -196,12 +196,12 @@
|
||||
const myaxios = axios.create();
|
||||
myaxios.defaults.baseURL = "{{ base_url }}";
|
||||
</script>
|
||||
<script src="{{ base_url }}/system/author/js/vue.min.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-i18n.min.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/autosize.min.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/author.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-blox-config.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue.min.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-i18n.min.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/autosize.min.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/author.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-blox-config.js?20200405"></script>
|
||||
<script>
|
||||
let formatConfig = {{ settings.formats|json_encode() }};
|
||||
let language = {{ settings.language|json_encode() }};
|
||||
@ -211,13 +211,13 @@
|
||||
|
||||
{{ assets.renderEditorJS() }}
|
||||
|
||||
<script src="{{ base_url }}/system/author/js/vue-blox.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-posts.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/sortable.min.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vuedraggable.umd.min.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-navi.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-meta.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/lazy-video.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-blox.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-posts.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/sortable.min.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vuedraggable.umd.min.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-navi.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-meta.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/lazy-video.js?20200405"></script>
|
||||
|
||||
{{ assets.renderJS() }}
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200226" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200405" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
|
||||
|
||||
{{ assets.renderCSS() }}
|
||||
@ -83,30 +83,30 @@
|
||||
</article>
|
||||
<footer></footer>
|
||||
</div>
|
||||
<script src="{{ base_url }}/system/author/js/axios.min.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/axios.min.js?20200405"></script>
|
||||
<script>
|
||||
const myaxios = axios.create();
|
||||
myaxios.defaults.baseURL = "{{ base_url }}";
|
||||
</script>
|
||||
<script src="{{ base_url }}/system/author/js/vue.min.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-i18n.min.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/autosize.min.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/sortable.min.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vuedraggable.umd.min.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/author.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue.min.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-i18n.min.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/autosize.min.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/sortable.min.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vuedraggable.umd.min.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/author.js?20200405"></script>
|
||||
|
||||
<script>
|
||||
let language = {{ settings.language|json_encode() }};
|
||||
let vuejsLabels = {{ settings.vuejsLabels|json_encode() }};
|
||||
let language = {{ settings.language|json_encode() }};
|
||||
let vuejsLabels = {{ settings.vuejsLabels|json_encode() }};
|
||||
let navigation = {{ navigation|json_encode() }};
|
||||
</script>
|
||||
|
||||
{{ assets.renderEditorJS() }}
|
||||
|
||||
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-editor.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-meta.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-navi.js?20200226"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-editor.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-meta.js?20200405"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-navi.js?20200405"></script>
|
||||
|
||||
{{ assets.renderJS() }}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user