Skip to content
Snippets Groups Projects
Commit ed84d675 authored by Mike Herchel's avatar Mike Herchel
Browse files

Re-arrange the order of some form fields.

parent 1fb26d8e
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@
"minimum-stability": "dev",
"support": {
"issues": "https://www.drupal.org/project/issues/quicklink",
"source": "http://cgit.drupalcode.org/quicklink"
"source": "https://git.drupalcode.org/project/quicklink"
},
"require": {}
}
......@@ -3,7 +3,7 @@ quicklink.settings:
type: config_entity
label: 'Quicklink Configuration'
mapping:
# Ignore tab
# Prefetch Ignore Settings tab
ignore_admin_paths:
type: boolean
label: 'Do not prefetch admin paths'
......@@ -22,7 +22,7 @@ quicklink.settings:
ignore_selectors:
type: string
label: 'Ignore these selectors'
# Overrides tab
# Optional Overrides tab
selector:
type: string
label: 'Override parent selector'
......@@ -32,7 +32,7 @@ quicklink.settings:
prefetch_only_paths:
type: string
label: 'Prefetch these paths only'
# When to Prefetch tab
# When to Load Library tab
no_load_when_authenticated:
type: boolean
label: 'Prefetch for anonymous users only'
......@@ -44,14 +44,6 @@ quicklink.settings:
label: 'Do not load library on these content types'
sequence:
type: string
# Polyfill tab
load_polyfill:
type: boolean
label: 'Load Intersection Observer polyfill'
# Debug tab
enable_debug_mode:
type: boolean
label: 'Enable debug mode'
# Throttle Options tab
total_request_limit:
type: integer
......@@ -59,9 +51,17 @@ quicklink.settings:
concurrency_throttle_limit:
type: integer
label: 'Concurrency throttle limit'
idle_wait_timeout:
type: integer
label: 'Idle wait timeout'
viewport_delay:
type: integer
label: 'Viewport delay'
idle_wait_timeout:
type: integer
label: 'Idle wait timeout'
# Extended Browser Support tab
load_polyfill:
type: boolean
label: 'Load Intersection Observer polyfill'
# Debug tab
enable_debug_mode:
type: boolean
label: 'Enable debug mode'
......@@ -63,8 +63,8 @@ class QuicklinkConfigForm extends ConfigFormBase {
$parameterFieldsToValidate = array(
'total_request_limit',
'concurrency_throttle_limit',
'idle_wait_timeout',
'viewport_delay',
'idle_wait_timeout',
);
foreach ($parameterFieldsToValidate as $value) {
......@@ -226,23 +226,23 @@ class QuicklinkConfigForm extends ConfigFormBase {
'#size' => 10,
'#default_value' => $config->get('concurrency_throttle_limit', 0),
];
$form['throttle_options']['idle_wait_timeout'] = [
$form['throttle_options']['viewport_delay'] = [
'#type' => 'number',
'#title' => t('Set idle timeout value'),
'#title' => t('Viewport Delay'),
'#field_suffix' => t('ms'),
'#description' => t('Amount of time the browser must be idle before prefetching, in milliseconds. Default is 2000 ms.'),
'#description' => t('Amount of time each link needs to stay inside the viewport before being prefetched. Default is 0 ms.'),
'#maxlength' => 10,
'#size' => 10,
'#default_value' => $config->get('idle_wait_timeout', 2000),
'#default_value' => $config->get('viewport_delay', 0),
];
$form['throttle_options']['viewport_delay'] = [
$form['throttle_options']['idle_wait_timeout'] = [
'#type' => 'number',
'#title' => t('Viewport Delay'),
'#title' => t('Set idle timeout value'),
'#field_suffix' => t('ms'),
'#description' => t('Amount of time each link needs to stay inside the viewport before being prefetched. Default is 0 ms.'),
'#description' => t('Amount of time the browser must be idle before prefetching, in milliseconds. Default is 2000 ms.'),
'#maxlength' => 10,
'#size' => 10,
'#default_value' => $config->get('viewport_delay', 0),
'#default_value' => $config->get('idle_wait_timeout', 2000),
];
// Prefetch Paths Only Tab
......@@ -314,8 +314,8 @@ class QuicklinkConfigForm extends ConfigFormBase {
$parameterFieldsToValidate = array(
'total_request_limit',
'concurrency_throttle_limit',
'idle_wait_timeout',
'viewport_delay',
'idle_wait_timeout',
);
foreach ($parameterFieldsToValidate as $value) {
......@@ -350,8 +350,8 @@ class QuicklinkConfigForm extends ConfigFormBase {
->set('allowed_domains', trim($form_state->getValue('allowed_domains')))
->set('total_request_limit', $form_state->getValue('total_request_limit'))
->set('concurrency_throttle_limit', $form_state->getValue('concurrency_throttle_limit'))
->set('idle_wait_timeout', $form_state->getValue('idle_wait_timeout'))
->set('viewport_delay', $form_state->getValue('viewport_delay'))
->set('idle_wait_timeout', $form_state->getValue('idle_wait_timeout'))
->set('load_polyfill', $form_state->getValue('load_polyfill'))
->set('enable_debug_mode', $form_state->getValue('enable_debug_mode'))
->save();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment