remove and deprecate image preload setting - we will now always preload

This commit is contained in:
Mario
2025-05-13 08:20:46 +00:00
parent a28dd9f2cf
commit 9b36c39eff
5 changed files with 6 additions and 24 deletions

View File

@@ -25,7 +25,6 @@ class Display {
$thread_allow = ((!empty($_POST['thread_allow'])) ? intval($_POST['thread_allow']) : 0);
$preload_images = ((x($_POST,'preload_images')) ? intval($_POST['preload_images']) : 0);
$user_scalable = ((x($_POST,'user_scalable')) ? intval($_POST['user_scalable']) : 0);
$nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0);
$title_tosource = ((x($_POST,'title_tosource')) ? intval($_POST['title_tosource']) : 0);
@@ -42,7 +41,6 @@ class Display {
set_pconfig(local_channel(), 'system', 'thread_allow', $thread_allow);
set_pconfig(local_channel(),'system','preload_images',$preload_images);
set_pconfig(local_channel(),'system','user_scalable',$user_scalable);
set_pconfig(local_channel(),'system','update_interval', $browser_update);
set_pconfig(local_channel(),'system','itemspage', $itemspage);
@@ -150,9 +148,6 @@ class Display {
$thread_allow = get_pconfig(local_channel(), 'system', 'thread_allow', true);
$preload_images = get_pconfig(local_channel(),'system','preload_images');
$preload_images = (($preload_images===false)? '0': $preload_images); // default if not set: 0
$user_scalable = get_pconfig(local_channel(),'system','user_scalable');
$user_scalable = (($user_scalable===false)? '0': $user_scalable); // default if not set: 0
@@ -197,7 +192,6 @@ class Display {
'$schema' => (($schemas) ? array('schema', t('Select scheme'), $existing_schema, '' , $schemas) : false),
'$thread_allow' => ['thread_allow', t('Threaded conversation view'), $thread_allow, t('Display replies below their parent message (default yes)'), $yes_no],
'$preload_images' => array('preload_images', t("Preload images before rendering the page"), $preload_images, t("The subjective page load time will be longer but the page will be ready when displayed"), $yes_no),
'$user_scalable' => array('user_scalable', t("Enable user zoom on mobile devices"), $user_scalable, '', $yes_no),
'$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')),
'$itemspage' => array('itemspage', t("Maximum number of conversations to load at any time:"), $itemspage, t('Maximum of 30 items')),

View File

@@ -1214,8 +1214,6 @@ class App {
$user_scalable = ((local_channel()) ? get_pconfig(local_channel(), 'system', 'user_scalable', 0) : 0);
$preload_images = ((local_channel()) ? get_pconfig(local_channel(), 'system', 'preload_images', 0) : 0);
$interval = ((local_channel()) ? get_pconfig(local_channel(), 'system', 'update_interval') : 80000);
if ($interval < 10000) {
$interval = 80000;

View File

@@ -1169,25 +1169,17 @@ function liveUpdate(notify_id) {
var dready = new Date();
console.log('DATA ready in: ' + (dready - dstart)/1000 + ' seconds.');
if(update_mode === 'update' || preloadImages) {
console.log('LOADING images...');
imagesLoaded(data, function () {
var iready = new Date();
console.log('IMAGES ready in: ' + (iready - dready)/1000 + ' seconds.');
console.log('LOADING images...');
imagesLoaded(data, function () {
var iready = new Date();
console.log('IMAGES ready in: ' + (iready - dready)/1000 + ' seconds.');
page_load = false;
scroll_next = false;
updateConvItems(update_mode,data);
in_progress = false;
});
}
else {
page_load = false;
scroll_next = false;
updateConvItems(update_mode,data);
in_progress = false;
}
});
});
}

View File

@@ -16,7 +16,6 @@
var justifiedGalleryActive = false;
{{if $channel_hash}}var channelHash = '{{$channel_hash}}';{{/if}}
var channelId = {{if $channel_id}}{{$channel_id}}{{else}}false{{/if}};{{* Used in e.g. autocomplete *}}
var preloadImages = {{$preload_images}};
var auto_save_draft = {{$auto_save_draft}};
{{if $module}}var module = '{{$module}}';{{/if}}
</script>

View File

@@ -61,7 +61,6 @@
{{include file="field_checkbox.tpl" field=$nosmile}}
{{include file="field_checkbox.tpl" field=$title_tosource}}
{{include file="field_checkbox.tpl" field=$user_scalable}}
{{include file="field_checkbox.tpl" field=$preload_images}}
{{include file="field_checkbox.tpl" field=$start_menu}}
{{include file="field_checkbox.tpl" field=$thread_allow}}
<div class="settings-submit-wrapper" >