1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-09 15:47:09 +02: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

@@ -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;