1
0
mirror of https://github.com/typemill/typemill.git synced 2025-10-17 15:46:28 +02:00

Version 1.2.8. Image Management

This commit is contained in:
Sebastian
2018-12-04 21:23:15 +01:00
parent 979ebebe1b
commit 39d59df52a
12 changed files with 70 additions and 53 deletions

View File

@@ -67,7 +67,10 @@ class ProcessImage
$tmpFolder = $basePath . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR;
$originalFolder = $basePath . DIRECTORY_SEPARATOR . 'original' . DIRECTORY_SEPARATOR;
$liveFolder = $basePath . DIRECTORY_SEPARATOR . 'live' . DIRECTORY_SEPARATOR;
if(!file_exists($originalFolder)){ mkdir($originalFolder, 0774, true); }
if(!file_exists($liveFolder)){ mkdir($liveFolder, 0774, true); }
$name = uniqid();
$files = scandir($tmpFolder);
@@ -232,7 +235,7 @@ class ProcessImage
}
public function saveOriginal($folder, $image, $name, $type)
{
{
if(!file_exists($folder))
{
mkdir($folder, 0774, true);
@@ -277,6 +280,13 @@ class ProcessImage
public function clearTempFolder()
{
$folder = getcwd() . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR;
if(!file_exists($folder))
{
mkdir($folder, 0774, true);
return true;
}
$files = scandir($folder);
$result = true;

View File

@@ -8,13 +8,15 @@ class Settings
{
$settings = self::getDefaultSettings();
$userSettings = self::getUserSettings();
$imgSettings = isset($settings['images']) ? $settings['images'] : [];
if($userSettings)
{
$imgSettings = $settings['images'];
$settings = array_merge($settings, $userSettings);
$settings['setup'] = false;
}
$settings['images'] = isset($userSettings['images']) ? array_merge($imgSettings, $userSettings['images']) : $imgSettings;
$settings['themePath'] = $settings['rootPath'] . $settings['themeFolder'] . DIRECTORY_SEPARATOR . $settings['theme'];
@@ -48,7 +50,7 @@ class Settings
'version' => '1.2.8',
'setup' => true,
'welcome' => true,
'images' => ['live' => ['width' => 720], 'mlibrary' => ['width' => 50, 'height' => 50]],
'images' => ['live' => ['width' => 820], 'mlibrary' => ['width' => 50, 'height' => 50]],
];
}

View File

@@ -1447,16 +1447,22 @@ label .help, .label .help{
display: block;
}
.hidden{
display: none;
visibility: hidden;
}
.hidden .blox:hover{
background: #fff;
}
.component{
position: relative;
position: absolute;
width: 100%;
z-index:9;
}
.format-bar .hidden{
display: none;
}
.format-bar .component{
position: relative;
}
.fade-editor-enter-active{
transition: opacity .5s;
}
@@ -1475,7 +1481,7 @@ label .help, .label .help{
.format-bar .blox-editor{
display: inline;
}
.format-item{
button.format-item{
margin-right: 2px;
padding: 5px;
background: #70c1b3;
@@ -1487,7 +1493,7 @@ label .help, .label .help{
height: 40px;
text-align: center;
}
.format-item:hover{
button.format-item:hover{
background: #66b0a3;
cursor: pointer;
}

View File

@@ -2,7 +2,7 @@ const eventBus = new Vue();
const contentComponent = Vue.component('content-block', {
props: ['body'],
template: '<div ref="bloxcomponent" class="blox-editor"><div :class="{ editactive: edit }"><div @keyup.enter="submitBlock" @click="getData"><div class="component"><transition name="fade-editor"><component :disabled="disabled" :compmarkdown="compmarkdown" @updatedMarkdown="compmarkdown = $event" :is="componentType"></component></transition><div class="blox-buttons" v-if="edit"><button class="edit" :disabled="disabled" @click.prevent="saveBlock">save</button><button class="cancel" :disabled="disabled" @click.prevent="switchToPreviewMode">cancel</button></div></div><div :class="preview"><slot></slot></div></div><div class="sideaction" v-if="body"><button class="delete" :disabled="disabled" title="delete content-block" @click.prevent="deleteBlock($event)"><i class="icon-cancel"></i></button></div></div></div>',
template: '<div ref="bloxcomponent" class="blox-editor"><div :class="{ editactive: edit }"><div @keyup.enter="submitBlock" @click="getData"><div class="component" ref="component"><transition name="fade-editor"><component :disabled="disabled" :compmarkdown="compmarkdown" @updatedMarkdown="compmarkdown = $event" :is="componentType"></component></transition><div class="blox-buttons" v-if="edit"><button class="edit" :disabled="disabled" @click.prevent="saveBlock">save</button><button class="cancel" :disabled="disabled" @click.prevent="switchToPreviewMode">cancel</button></div></div><div :class="preview" ref="preview"><slot></slot></div></div><div class="sideaction" v-if="body"><button class="delete" :disabled="disabled" title="delete content-block" @click.prevent="deleteBlock($event)"><i class="icon-cancel"></i></button></div></div></div>',
data: function () {
return {
preview: 'visible',
@@ -27,12 +27,16 @@ const contentComponent = Vue.component('content-block', {
this.edit = true; /* show the edit-mode */
this.compmarkdown = self.$root.$data.blockMarkdown; /* get markdown data */
this.componentType = self.$root.$data.blockType; /* get block-type of element */
this.$nextTick(function () {
this.$refs.preview.style.minHeight = this.$refs.component.offsetHeight + 'px';
});
},
closeComponents: function()
{
this.preview = 'visible';
this.edit = false;
this.componentType = false;
this.$refs.preview.style.minHeight = "auto";
},
switchToPreviewMode: function()
{
@@ -47,6 +51,7 @@ const contentComponent = Vue.component('content-block', {
self.$root.$data.blockMarkdown = false;
self.$root.$data.file = false;
publishController.errors.message = false; /* delete all error messages */
this.$refs.preview.style.minHeight = "auto";
},
freezePage: function()
{
@@ -67,14 +72,7 @@ const contentComponent = Vue.component('content-block', {
if(self.$root.$data.blockType != '')
{
this.switchToEditMode();
}
/*
if(self.$root.$data.freeze == false && self.$root.$data.blockType != '')
{
this.switchToEditMode();
}
*/
}
},
submitBlock: function(){
var emptyline = /^\s*$(?:\r\n?|\n)/gm;
@@ -421,6 +419,7 @@ const imageComponent = Vue.component('image-component', {
self.imgpreview = e.target.result;
self.$emit('updatedMarkdown', '![](imgplchldr)');
/* load image to server */
var url = self.$root.$data.root + '/api/v1/image';

View File

@@ -35,7 +35,7 @@
</article>
<footer></footer>
</div>
<script src="{{ base_url }}/system/author/js/color-picker.min.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/author.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/color-picker.min.js?20181203"></script>
<script src="{{ base_url }}/system/author/js/author.js?20181203"></script>
</body>
</html>

View File

@@ -29,6 +29,6 @@
{% block content %}{% endblock %}
</div>
<script src="{{ base_url }}/system/author/js/auth.js?20181030"></script>
<script src="{{ base_url }}/system/author/js/auth.js?20181203"></script>
</body>
</html>

View File

@@ -19,7 +19,7 @@
<link rel="stylesheet" href="{{ base_url }}/system/author/css/fontello/css/fontello.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20181110" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20181203" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
</head>
<body>
@@ -36,13 +36,13 @@
</article>
<footer></footer>
</div>
<script src="{{ base_url }}/system/author/js/vue.min.js?20181030"></script>
<script src="{{ base_url }}/system/author/js/autosize.min.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/sortable.min.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/vuedraggable.min.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/author.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/vue-blox.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/vue-navi.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/vue.min.js?20181203"></script>
<script src="{{ base_url }}/system/author/js/autosize.min.js?20181203"></script>
<script src="{{ base_url }}/system/author/js/sortable.min.js?20181203"></script>
<script src="{{ base_url }}/system/author/js/vuedraggable.min.js?20181203"></script>
<script src="{{ base_url }}/system/author/js/author.js?20181203"></script>
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20181203"></script>
<script src="{{ base_url }}/system/author/js/vue-blox.js?20181203"></script>
<script src="{{ base_url }}/system/author/js/vue-navi.js?20181203"></script>
</body>
</html>

View File

@@ -19,7 +19,7 @@
<link rel="stylesheet" href="{{ base_url }}/system/author/css/fontello/css/fontello.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20181110" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20181203" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
</head>
<body>
@@ -36,13 +36,13 @@
</article>
<footer></footer>
</div>
<script src="{{ base_url }}/system/author/js/vue.min.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/autosize.min.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/sortable.min.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/vuedraggable.min.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/author.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/vue-editor.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/vue-navi.js?20181110"></script>
<script src="{{ base_url }}/system/author/js/vue.min.js?20181203"></script>
<script src="{{ base_url }}/system/author/js/autosize.min.js?20181203"></script>
<script src="{{ base_url }}/system/author/js/sortable.min.js?20181203"></script>
<script src="{{ base_url }}/system/author/js/vuedraggable.min.js?20181203"></script>
<script src="{{ base_url }}/system/author/js/author.js?20181203"></script>
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20181203"></script>
<script src="{{ base_url }}/system/author/js/vue-editor.js?20181203"></script>
<script src="{{ base_url }}/system/author/js/vue-navi.js?20181203"></script>
</body>
</html>