1
0
mirror of https://github.com/typemill/typemill.git synced 2025-10-29 04:06:24 +01:00

Version 1.4.9: Switch image quality in meta, fix files in hidden folder

This commit is contained in:
trendschau
2021-09-03 11:19:33 +02:00
parent 5f597c31ad
commit c07f5d54d4
5 changed files with 46 additions and 9 deletions

View File

@@ -1,14 +1,14 @@
meta:
title: 'Setup Your Website'
description: 'Typemill provides detailed settings, and you have access to nearly all settings in the author panel. Learn the basics in this short video:'
heroimage: media/live/1528492471.svg
heroimage: media/live/jack-ward-wbs1qewclne-unsplash.jpeg
heroimagealt: null
owner: trendschau
author: 'Sebastian Schürmanns'
allowedrole: null
alloweduser: null
manualdate: null
modified: '2021-09-02'
modified: '2021-08-01'
created: '2021-05-27'
time: 21-02-24
navtitle: 'setup your website'

View File

@@ -5,14 +5,14 @@ meta:
heroimagealt: null
owner: null
author: 'Sebastian Schürmanns'
allowedrole: null
alloweduser: null
manualdate: null
modified: '2021-06-13'
created: null
time: null
navtitle: ''
hide: true
allowedrole: null
alloweduser: null
hide: false
seo:
heroimage: media/live/bildschirmfoto-zu-2019-08-30-20-46-29.png
heroimagealt: Alt-Text

View File

@@ -162,7 +162,7 @@ class PageController extends Controller
$item = Folder::getItemForUrl($structure, $urlRel, $uri->getBasePath());
# if the item is a folder and if that folder is not hidden
if($item && isset($item->hide) && !$item->hide)
if($item && $item->elementType == 'folder' && isset($item->hide) && !$item->hide)
{
# use the navigation instead of the structure so that hidden elements are erased
$item = Folder::getItemForUrl($navigation, $urlRel, $uri->getBaseUrl(), NULL, $home);
@@ -396,7 +396,7 @@ class PageController extends Controller
$extended = false;
}
}
# cache structure
$cache->updateCache('cache', 'structure.txt', 'lastCache.txt', $structure);
@@ -415,7 +415,9 @@ class PageController extends Controller
}
# load and return the cached structure, because might be manipulated with navigation....
return $this->getCachedStructure($cache);
$structure = $this->getCachedStructure($cache);
return $structure;
}
# creates a file that holds all hide flags and navigation titles

View File

@@ -522,6 +522,9 @@ Vue.component('component-image', {
' :value="value"' +
'@input="update($event, name)">' +
'</div>' +
'<div class="dib w-100 mt2">' +
'<button class="w-100 pointer ba br1 b--tm-green bg--tm-gray black pa2 ma0 tc" @click.prevent="switchQuality()">{{ getQualityLabel() }}</button>' +
'</div>' +
'</div>' +
'<div v-if="description" class="w-100 dib"><p>{{ description|translate }}</p></div>' +
'<div v-if="errors[name]" class="error">{{ errors[name] }}</div>' +
@@ -539,12 +542,21 @@ Vue.component('component-image', {
imgpreview: false,
showmedialib: false,
load: false,
quality: false,
}
},
mounted: function(){
if(this.value !== null && this.value !== '')
{
this.imgpreview = myaxios.defaults.baseURL + '/' + this.value;
if(this.value.indexOf("media/live") > -1 )
{
this.quality = 'live';
}
else if(this.value.indexOf("media/original") > -1)
{
this.quality = 'original';
}
}
},
methods: {
@@ -567,6 +579,29 @@ Vue.component('component-image', {
this.imgpreview = false;
this.update('');
},
getQualityLabel: function()
{
if(this.quality == 'live')
{
return 'switch quality to: original';
}
return 'switch quality to: resized';
},
switchQuality: function()
{
if(this.quality == 'live')
{
var newUrl = this.value.replace("media/live", "media/original");
this.update(newUrl);
this.quality = 'original';
}
else
{
var newUrl = this.value.replace("media/original", "media/live");
this.update(newUrl);
this.quality = 'live';
}
},
openmedialib: function()
{
this.showmedialib = true;

View File

@@ -1,6 +1,6 @@
<section class="landingpageintro w-100 dib tc bt bl br bb">
<div class="cover bg-left bg-center-l" {% if settings.themes.cyanine.introImage %}style="background-image: url({{image.img_url}});background-color:rgba(255,255,255,{{settings.themes.cyanine.introImageOpacity|default('0.8')}});background-blend-mode: lighten;" {% endif%} >
<div class="cover bg-left bg-center-l" {% if settings.themes.cyanine.introImage %}style="background-image: url({{metatabs.meta.heroimage}});background-color:rgba(255,255,255,{{settings.themes.cyanine.introImageOpacity|default('0.8')}});background-blend-mode: lighten;" {% endif%} >
<div class="mw7 pb7 pt6 ph3 center">
<div class="introbg pa4">