Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
7ebd59f0
Commit
7ebd59f0
authored
Feb 26, 2020
by
Marc Egger
Browse files
rename data-typeahead-tag-static-list to data-typeahead-static-list
parent
e55abf05
Pipeline
#3339
passed with stages
in 3 minutes and 51 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Documentation-develop/HTML.md
View file @
7ebd59f0
...
...
@@ -41,12 +41,12 @@ call to `api/load.php` upon change.
## Typeahead
Typeahead capable text input elements will be defined by the following attributes:
### .class='qfq-typeahead'
### .data-typeahead-sip
The SIP will store:
The SIP will store:
Use with SQL:
`typeAheadSql`
...
...
@@ -56,21 +56,21 @@ Use with LDAP: `typeAheadLdap`
*
`typeAheadLdapSearch`
*
`typeAheadLdapValuePrintf`
*
`typeAheadLdapKeyPrintf`
### .data-typeahead-limit
*
Defines the limit of entries shown on the client. Default on client is 5. The server will always send a value.
*
Defines the limit of entries shown on the client. Default on client is 5. The server will always send a value.
The server default is 20.
### .data-typeahead-minlength
*
Defines the string minlength, typed by the user, before the first lookup is started. Default is 2.
### data-typeahead-pedantic
*
If present, only suggested values are allowed in the input element
### .data-typeahead-
tag-
static-list
### .data-typeahead-static-list
*
JSON encoded list of suggestions, which are served with the HTML input element.
*
If both this list and the attribute
`data-typeahead-sip`
are given, then the typeahead
...
...
@@ -80,8 +80,8 @@ suggestions are taken from both sources.
`[{value: "Alaska", key: "AK"}, {value: "Alabama", key: "AL"}]`
## Tags Form Element
The tags form element depends on Typeahead by default. The following attributes define the tags form element, additional
The tags form element depends on Typeahead by default. The following attributes define the tags form element, additional
to the attributes for Typeahead (see above).
Mockups can be found in
`mockup/typahead.php`
...
...
@@ -96,10 +96,10 @@ Mockups can be found in `mockup/typahead.php`
### .value
*
JSON encoded list of key value pairs of existing tags. e.g.
*
JSON encoded list of key value pairs of existing tags. e.g.
`[{value: "Alaska", key: "AK"}, {value: "Alabama", key: "AL"}]`
### POST data
*
JSON encoded list of key value pairs of the selected tags. e.g.
...
...
javascript/src/TypeAhead.js
View file @
7ebd59f0
...
...
@@ -94,7 +94,7 @@ var QfqNS = QfqNS || {};
var
existingTags
=
$element
.
val
()
!==
''
?
JSON
.
parse
(
$element
.
val
())
:
[];
// static list of tags
var
staticList
=
$element
.
data
(
'
typeahead-
tag-
static-list
'
);
var
staticList
=
$element
.
data
(
'
typeahead-static-list
'
);
staticList
=
staticList
!==
undefined
&&
staticList
!==
''
?
staticList
:
[];
// get initial suggestions
...
...
@@ -261,7 +261,7 @@ var QfqNS = QfqNS || {};
$shadowElement
=
n
.
TypeAhead
.
makeShadowElement
(
$element
);
// get static list of tags
var
staticList
=
$element
.
data
(
'
typeahead-
tag-
static-list
'
);
var
staticList
=
$element
.
data
(
'
typeahead-static-list
'
);
staticList
=
staticList
!==
undefined
&&
staticList
!==
''
?
staticList
:
[];
// get initial suggestions
...
...
mockup/typeahead.php
View file @
7ebd59f0
...
...
@@ -121,7 +121,7 @@
data-typeahead-sip=
"abcde"
data-typeahead-minlength=
"1"
data-typeahead-limit=
"3"
data-typeahead-
tag-
static-list=
"
<?php
echo
$staticListSafeJson
;
?>
"
data-typeahead-static-list=
"
<?php
echo
$staticListSafeJson
;
?>
"
data-typeahead-initial-suggestion=
"
<?php
echo
$initialSuggestionsSafeJson
;
?>
"
>
</div>
...
...
@@ -137,7 +137,7 @@
<input
id=
"dropdown2"
type=
"text"
class=
"form-control qfq-typeahead"
name=
"dropdown2"
data-typeahead-sip=
"abcdef"
data-typeahead-limit=
"10"
data-typeahead-minlength=
"1"
data-typeahead-pedantic=
"true"
required
data-typeahead-
tag-
static-list=
"
<?php
echo
$staticListSafeJson
;
?>
"
>
data-typeahead-static-list=
"
<?php
echo
$staticListSafeJson
;
?>
"
>
</div>
<div
class=
"col-md-4"
>
...
...
@@ -183,7 +183,7 @@
data-typeahead-tags=
"true"
data-typeahead-tag-delimiters=
"[9, 13]"
data-typeahead-
tag-
static-list=
"
<?php
echo
$staticListSafeJson
;
?>
"
data-typeahead-static-list=
"
<?php
echo
$staticListSafeJson
;
?>
"
data-typeahead-initial-suggestion=
"
<?php
echo
$initialSuggestionsSafeJson
;
?>
"
value=
"
<?php
echo
$tagsSafeJson
;
?>
"
>
...
...
@@ -205,7 +205,7 @@
data-typeahead-tags=
"true"
data-typeahead-pedantic=
"true"
data-typeahead-tag-delimiters=
"[9, 44]"
data-typeahead-
tag-
static-list=
"
<?php
echo
$staticListSafeJson
;
?>
"
data-typeahead-static-list=
"
<?php
echo
$staticListSafeJson
;
?>
"
data-typeahead-initial-suggestion=
"
<?php
echo
$initialSuggestionsSafeJson
;
?>
"
value=
"
<?php
echo
$tagsSafeJson
;
?>
"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment