Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Framasoft
Framasite
framasite-grav
Commits
33a63d8a
Commit
33a63d8a
authored
Jul 15, 2019
by
JosephK
Browse files
Alert for forbidden folders
parent
52874f24
Changes
1
Hide whitespace changes
Inline
Side-by-side
user/plugins/customadmin/customadmin.js
View file @
33a63d8a
...
...
@@ -133,6 +133,22 @@ jQuery(document).ready(function () {
jQuery
(
lockedPlugins
.
join
()).
hide
();
jQuery
(
'
[data-grav-field-name="data[twofa_enabled]"]
'
).
parent
().
parent
().
hide
();
/* Forbidden folders */
var
forbidden
=
[
'
git
'
,
'
cache
'
,
'
bin
'
,
'
logs
'
,
'
backup
'
,
'
tests
'
];
var
folderFields
=
[
'
#new-modular [name="data[title]"]
'
,
'
#new-modular [name="data[folder]"]
'
,
'
#new-page [name="data[title]"]
'
,
'
#new-page [name="data[folder]"]
'
];
jQuery
(
folderFields
.
join
(
'
,
'
)).
on
(
'
focusout
'
,
function
()
{
if
(
RegExp
(
`(
${
forbidden
.
join
(
'
|
'
)}
)`
).
test
(
jQuery
(
this
).
val
().
toLowerCase
()))
{
alert
(
`Les mots
${
forbidden
.
join
(
'
,
'
)}
ne sont pas autorisés`
);
jQuery
(
'
#new-page [name="data[folder]"], #new-page [name="data[title]"]
'
).
val
(
''
);
jQuery
(
this
).
focus
();
}
});
/** CustomCSS - ThemePicker *********************************** */
...
...
spf
@spf
mentioned in issue
#112 (closed)
·
Jul 15, 2019
mentioned in issue
#112 (closed)
mentioned in issue #112
Toggle commit list
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment