Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quicklink-3209684
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
quicklink-3209684
Commits
ed84d675
Commit
ed84d675
authored
4 years ago
by
Mike Herchel
Browse files
Options
Downloads
Patches
Plain Diff
Re-arrange the order of some form fields.
parent
1fb26d8e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
composer.json
+1
-1
1 addition, 1 deletion
composer.json
config/schema/quicklink.schema.yml
+14
-14
14 additions, 14 deletions
config/schema/quicklink.schema.yml
src/Form/QuicklinkConfigForm.php
+11
-11
11 additions, 11 deletions
src/Form/QuicklinkConfigForm.php
with
26 additions
and
26 deletions
composer.json
+
1
−
1
View file @
ed84d675
...
...
@@ -8,7 +8,7 @@
"minimum-stability"
:
"dev"
,
"support"
:
{
"issues"
:
"https://www.drupal.org/project/issues/quicklink"
,
"source"
:
"http://
c
git.drupalcode.org/quicklink"
"source"
:
"http
s
://git.drupalcode.org/
project/
quicklink"
},
"require"
:
{}
}
This diff is collapsed.
Click to expand it.
config/schema/quicklink.schema.yml
+
14
−
14
View file @
ed84d675
...
...
@@ -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'
This diff is collapsed.
Click to expand it.
src/Form/QuicklinkConfigForm.php
+
11
−
11
View file @
ed84d675
...
...
@@ -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 prefetch
ing, in milliseconds
. Default is
200
0 ms.'
),
'#description'
=>
t
(
'Amount of time
each link needs to stay inside the viewport
before
being
prefetch
ed
. Default is 0 ms.'
),
'#maxlength'
=>
10
,
'#size'
=>
10
,
'#default_value'
=>
$config
->
get
(
'
idle_wait_timeout'
,
200
0
),
'#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
prefetch
ed
. Default is 0 ms.'
),
'#description'
=>
t
(
'Amount of time
the browser must be idle
before prefetch
ing, in milliseconds
. Default is
200
0 ms.'
),
'#maxlength'
=>
10
,
'#size'
=>
10
,
'#default_value'
=>
$config
->
get
(
'
viewport_delay'
,
0
),
'#default_value'
=>
$config
->
get
(
'
idle_wait_timeout'
,
200
0
),
];
// 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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment