Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
iberculturaviva
iberculturaviva-mapas
Commits
1a5b4558
Commit
1a5b4558
authored
Dec 08, 2021
by
Alex Felippe Chiozo
Browse files
formata número de telefone no padrão internacional
parent
b072bcff
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
themes/IberCulturaViva/Theme.php
themes/IberCulturaViva/Theme.php
+7
-0
themes/IberCulturaViva/assets/js/editable.js
themes/IberCulturaViva/assets/js/editable.js
+11
-0
themes/IberCulturaViva/assets/vendor/libphonenumber-min.js
themes/IberCulturaViva/assets/vendor/libphonenumber-min.js
+2
-0
No files found.
themes/IberCulturaViva/Theme.php
View file @
1a5b4558
...
...
@@ -58,6 +58,13 @@ class Theme extends BaseV1\Theme{
});
}
function
includeVendorAssets
()
{
parent
::
includeVendorAssets
();
$this
->
enqueueScript
(
"vendor"
,
"libphonenumber-min"
,
"vendor/libphonenumber-min.js"
);
return
;
}
protected
function
_publishAssets
()
{
$this
->
asset
(
'img/home--agents.jpg'
,
false
);
$this
->
asset
(
'img/home--developers.jpg'
,
false
);
...
...
themes/IberCulturaViva/assets/js/editable.js
View file @
1a5b4558
...
...
@@ -92,6 +92,17 @@ jQuery(function(){
* Example: ['00-0009', '000-009', '0000-000']
*
*/
if
(
libphonenumber
!==
undefined
)
{
editable
.
input
.
$input
.
keypress
(
function
(
ev
)
{
current
=
editable
.
input
.
$input
.
val
().
replace
(
/
\s
/g
,
""
);
if
(
!
current
.
startsWith
(
"
+
"
))
{
current
=
`+
${
current
}
`
;
}
editable
.
input
.
$input
.
val
(
new
libphonenumber
.
AsYouType
().
input
(
current
));
return
;
});
return
;
}
if
(
MapasCulturais
.
phoneMasks
===
false
)
return
;
var
masks
=
MapasCulturais
.
phoneMasks
?
MapasCulturais
.
phoneMasks
:
[
'
(00) 0000-00009
'
,
'
(00) 00000-0000
'
];
editable
.
input
.
$input
.
mask
(
masks
[
0
],
{
onKeyPress
:
...
...
themes/IberCulturaViva/assets/vendor/libphonenumber-min.js
0 → 100644
View file @
1a5b4558
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
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