feat(altcha): add altcha validation layer to login
Some checks are pending
Cadoles/hydra-sql/pipeline/pr-develop Build started...
Some checks are pending
Cadoles/hydra-sql/pipeline/pr-develop Build started...
This commit is contained in:
@ -8,5 +8,4 @@
|
||||
// any CSS you import will output into a single css file (app.css in this case)
|
||||
import './styles/app.scss';
|
||||
|
||||
// start the Stimulus application
|
||||
import './bootstrap';
|
||||
import 'altcha';
|
||||
|
11
assets/bootstrap.js
vendored
11
assets/bootstrap.js
vendored
@ -1,11 +0,0 @@
|
||||
import { startStimulusApp } from '@symfony/stimulus-bridge';
|
||||
|
||||
// Registers Stimulus controllers from controllers.json and in the controllers/ directory
|
||||
export const app = startStimulusApp(require.context(
|
||||
'@symfony/stimulus-bridge/lazy-controller-loader!./controllers',
|
||||
true,
|
||||
/\.[jt]sx?$/
|
||||
));
|
||||
|
||||
// register any custom, 3rd party controllers here
|
||||
// app.register('some_controller_name', SomeImportedController);
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"controllers": [],
|
||||
"entrypoints": []
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
import { Controller } from '@hotwired/stimulus';
|
||||
|
||||
/*
|
||||
* This is an example Stimulus controller!
|
||||
*
|
||||
* Any element with a data-controller="hello" attribute will cause
|
||||
* this controller to be executed. The name "hello" comes from the filename:
|
||||
* hello_controller.js -> "hello"
|
||||
*
|
||||
* Delete this file or adapt it for your use!
|
||||
*/
|
||||
export default class extends Controller {
|
||||
connect() {
|
||||
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js';
|
||||
}
|
||||
}
|
722
assets/styles/theme.css
Normal file
722
assets/styles/theme.css
Normal file
@ -0,0 +1,722 @@
|
||||
input[type="radio"]:checked ~ .app-item {
|
||||
--tw-shadow: 0 10px 15px -3px rgb(22 78 99 / 0.3),
|
||||
0 4px 6px -4px rgb(22 78 99 / 0.3);
|
||||
background-color: rgb(76 233 14 / 0.15);
|
||||
}
|
||||
.header {
|
||||
background-color: rgb(75, 207, 158);
|
||||
width: 100%;
|
||||
color: white;
|
||||
}
|
||||
|
||||
section.header-logo a {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
width: auto;
|
||||
float: left;
|
||||
letter-spacing: -1px;
|
||||
font-size: 30px;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
color: #2c3e50;
|
||||
line-height: 30px;
|
||||
font-family: fontpvebold;
|
||||
}
|
||||
section.header-logo a span {
|
||||
color: #4bcf9e;
|
||||
font-size: 50px;
|
||||
}
|
||||
section.header-logo a svg {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.header-logo {
|
||||
margin-bottom: 15px;
|
||||
padding: 25px 0;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "fontpve";
|
||||
src: url("../fonts/oswald-regular-webfont.eot");
|
||||
src: url("../fonts/oswald-regular-webfont.eot?#iefix")
|
||||
format("embedded-opentype"),
|
||||
url("../fonts/oswald-regular-webfont.woff2") format("woff2"),
|
||||
url("../fonts/oswald-regular-webfont.woff") format("woff"),
|
||||
url("../fonts/oswald-regular-webfont.ttf") format("truetype"),
|
||||
url("../fonts/oswald-regular-webfont.svg#oswaldregular") format("svg");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "fontpvebold";
|
||||
src: url("../fonts/oswald-bold-webfont.eot");
|
||||
src: url("../fonts/oswald-bold-webfont.eot?#iefix")
|
||||
format("embedded-opentype"),
|
||||
url("../fonts/oswald-bold-webfont.woff2") format("woff2"),
|
||||
url("../fonts/oswald-bold-webfont.woff") format("woff"),
|
||||
url("../fonts/oswald-bold-webfont.ttf") format("truetype"),
|
||||
url("../fonts/oswald-bold-webfont.svg#oswaldbold") format("svg");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
a,
|
||||
a:visited,
|
||||
a:hover {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.row {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.logo-france-connect-fr:hover {
|
||||
content: url("../images/franceconnect-fr-hover.png");
|
||||
min-height: 58px;
|
||||
}
|
||||
|
||||
.logo-france-connect-en:hover {
|
||||
content: url("../images/franceconnect-en-hover.png");
|
||||
min-height: 58px;
|
||||
}
|
||||
|
||||
.logo-mse-connect-fr:hover {
|
||||
content: url("../images/MSEConnect-hover-fr.png");
|
||||
min-height: 56px;
|
||||
}
|
||||
|
||||
.logo-mse-connect-en:hover {
|
||||
content: url("../images/MSEConnect-hover-en.png");
|
||||
min-height: 56px;
|
||||
}
|
||||
|
||||
.facebook, .x, .instagram {
|
||||
height:24px;
|
||||
width:24px;
|
||||
}
|
||||
|
||||
.facebook:hover{
|
||||
content: url('../images/facebook-hover.png');
|
||||
}
|
||||
|
||||
.x:hover{
|
||||
content: url('../images/x-hover.png');
|
||||
}
|
||||
|
||||
.instagram:hover{
|
||||
content: url('../images/instagram-hover.png');
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
border-color: #66afe9;
|
||||
outline: 1em;
|
||||
}
|
||||
|
||||
#mesr {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "fontpve", "Source Sans Pro", "Helvetica Neue", Helvetica, Arial,
|
||||
sans-serif;
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
background-color: #fff;
|
||||
min-width: 320px;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
max-width: 1007px;
|
||||
margin: 15px auto 30px auto;
|
||||
}
|
||||
|
||||
#logo-mse {
|
||||
padding: 80px;
|
||||
}
|
||||
|
||||
#header {
|
||||
vertical-align: top;
|
||||
color: #fff;
|
||||
font-family: "fontpve", arial;
|
||||
}
|
||||
|
||||
.pvetools .dropdown .dropdown-toggle {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#pvemenu {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-weight: bold;
|
||||
background-color: #1c856aff;
|
||||
height: 35px;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
#pvelink {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
padding: 5px 0 0 1rem;
|
||||
display: inline-block;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#pvelink ul {
|
||||
list-style: none;
|
||||
float: left;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
#pvelink ul li {
|
||||
list-style: none;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#pvelink a {
|
||||
color: #fff !important;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#pvelink span {
|
||||
float: left;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.header-nav nav {
|
||||
display: inline-block;
|
||||
color: #2c3e50;
|
||||
min-height: 35px;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.header-nav nav ul {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.header-nav nav a {
|
||||
line-height: 35px;
|
||||
padding: 0 20px;
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
.header-nav nav:hover {
|
||||
background: #125444;
|
||||
}
|
||||
|
||||
.header-nav nav:hover a {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.language-flag {
|
||||
height: 20px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.pvetools .dropdown-menu {
|
||||
background: #1c856aff;
|
||||
min-width: 0px;
|
||||
border: 0px;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.dropdown-menu li a {
|
||||
color: #ffffff;
|
||||
background: #1c856aff;
|
||||
}
|
||||
|
||||
.dropdown-menu li a:hover {
|
||||
background: #125444;
|
||||
}
|
||||
|
||||
.link-fc {
|
||||
text-align: center;
|
||||
margin-top: 8px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.link-fc a {
|
||||
color: white;
|
||||
letter-spacing: 1px;
|
||||
text-decoration: none;
|
||||
}
|
||||
.link-fc a:hover {
|
||||
color: white;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#logo {
|
||||
z-index: 10;
|
||||
margin-left: 50px;
|
||||
width: 280px;
|
||||
display: inline-block;
|
||||
vertical-align: bottom;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#pvename {
|
||||
display: block;
|
||||
}
|
||||
#pvename a {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
width: auto;
|
||||
text-decoration: none;
|
||||
letter-spacing: -1px;
|
||||
font-size: 30px;
|
||||
color: #2c3e50;
|
||||
line-height: 30px;
|
||||
font-family: "fontpvebold";
|
||||
padding: 3.4rem 0;
|
||||
}
|
||||
|
||||
#pvename a > svg {
|
||||
width: 280px;
|
||||
}
|
||||
|
||||
#pvename a > span {
|
||||
color: #1c856aff;
|
||||
font-size: 50px;
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
#pvename a {
|
||||
padding: 3.4rem 0 3.4rem 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
#pvename {
|
||||
text-align: center;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#footer ul {
|
||||
text-align: center;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
#pvename a {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin: 10px auto;
|
||||
}
|
||||
|
||||
#pvename a > svg {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
#pvename a > span {
|
||||
display: block;
|
||||
line-height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
#boxlogin-wrapper {
|
||||
padding: 0 18px;
|
||||
width: 66%;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
#boxlogin {
|
||||
background-color: #2d3e50;
|
||||
color: #fff;
|
||||
font-family: arial;
|
||||
font-size: 13px;
|
||||
padding: 15px 30px 30px 30px;
|
||||
}
|
||||
|
||||
#boxlogin > * + * {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
#boxlogin-title {
|
||||
margin: 0;
|
||||
text-transform: uppercase;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
background-color: #1d2730;
|
||||
font-family: "fontpvebold", aroam;
|
||||
}
|
||||
#boxlogin-title h1 {
|
||||
font-size: 33px;
|
||||
padding: 10px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
margin-bottom: 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
label[for="login_login"] {
|
||||
padding-top: 10px;
|
||||
}
|
||||
#boxlogin .loginapp {
|
||||
text-align: center;
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
.loginapp-button img {
|
||||
border-radius: 2px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
object-fit: contain;
|
||||
min-height: 56px;
|
||||
}
|
||||
|
||||
.loginapp-button:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.separateur {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
text-align: center;
|
||||
padding: 0 2rem 1.3rem 2rem;
|
||||
}
|
||||
|
||||
#choixFC {
|
||||
width: 2.5rem;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
.text-right {
|
||||
text-align: right;
|
||||
}
|
||||
.separateur::after,
|
||||
.separateur::before {
|
||||
content: "";
|
||||
flex: 1;
|
||||
border-bottom: 2px solid #e8e8e8;
|
||||
}
|
||||
|
||||
#boxlogin .encart-erreur {
|
||||
color: #2d3e50;
|
||||
text-transform: uppercase;
|
||||
text-align: center;
|
||||
background-color: #fff;
|
||||
padding: 10px 2px;
|
||||
font-family: "fontpve", aroam;
|
||||
font-size: 15px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#boxlogin h2 {
|
||||
font-size: 25px;
|
||||
text-transform: uppercase;
|
||||
font-family: "fontpvebold", aroam;
|
||||
}
|
||||
|
||||
#boxlogin h3 {
|
||||
color: #fff;
|
||||
text-transform: uppercase;
|
||||
text-align: center;
|
||||
background-color: #4bcf9e;
|
||||
padding: 10px 2px;
|
||||
font-family: "fontpve", aroam;
|
||||
font-size: 15px;
|
||||
}
|
||||
#boxlogin h4 {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background-color: red;
|
||||
padding: 10px 2px;
|
||||
font-family: arial;
|
||||
font-size: 15px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
#pvelogin,
|
||||
#pvedescription {
|
||||
/* padding: 30px 15px 10px 15px; */
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#pvelogin input {
|
||||
font-size: 20px;
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
#pvelogin input:-webkit-autofil {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
#pvelogin button {
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
border-color: #fff;
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 10px 16px;
|
||||
font-size: 18px;
|
||||
line-height: 1.33;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
#pvelogin a {
|
||||
color: #fff;
|
||||
padding-top: 10px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#pvelogininfo a {
|
||||
text-decoration: underline;
|
||||
color: #2c3e50;
|
||||
font-family: arial;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
#pvelogininfo {
|
||||
font-family: arial;
|
||||
font-size: 13px;
|
||||
background-color: #fff;
|
||||
color: #2c3e50;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
#pvelogininfo ul {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#footer {
|
||||
clear: both;
|
||||
padding-top: 100px;
|
||||
text-transform: none;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#footer > nav.navbar.navbar-inverse {
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
#footer-copyright {
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
padding-top: 30px;
|
||||
padding-bottom: 30px;
|
||||
font-family: Arial;
|
||||
font-size: 12px;
|
||||
text-transform: initial;
|
||||
}
|
||||
|
||||
#footer-copyright img {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
#footerli01 {
|
||||
margin-left: 150px;
|
||||
}
|
||||
|
||||
#footer ul.nav.navbar-nav.navbar-left {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#footer ul.nav.navbar-nav > li > a {
|
||||
color: #ffffff;
|
||||
background-color: transparent;
|
||||
position: relative;
|
||||
display: block;
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
#footer ul.nav.navbar-nav > li > a:before {
|
||||
content: "/";
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#footer ul.nav.navbar-nav.navbar-left > li:hover > a {
|
||||
color: #fff;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#footer ul.nav.navbar-nav.navbar-left > li:hover > a:before {
|
||||
color: #fff;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
#footer-editor {
|
||||
text-align: right;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
@media (max-width: 1007px) {
|
||||
#wrapper {
|
||||
margin-top: 0px;
|
||||
}
|
||||
#boxlogin-wrapper {
|
||||
width: 100%;
|
||||
}
|
||||
#header {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
#pveuser {
|
||||
font-size: 15px;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
#pveuser small {
|
||||
font-size: 12px;
|
||||
top: -2px;
|
||||
}
|
||||
|
||||
#logo {
|
||||
margin-left: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
#footerli01 {
|
||||
margin-left: 0px;
|
||||
}
|
||||
#boxlogin .loginapp {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 550px) {
|
||||
#pvemenu {
|
||||
font-size: 80%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 400px) {
|
||||
#pvelink {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#logo {
|
||||
max-width: 46%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#boxlogin-wrapper {
|
||||
padding: 0 15px;
|
||||
}
|
||||
}
|
||||
|
||||
/* dispatcher error page */
|
||||
.alert-danger {
|
||||
background-color: #ff0000 !important;
|
||||
border-color: #ff0000 !important;
|
||||
color: #fff !important;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.alert-danger a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.alert-danger a:hover {
|
||||
color: unset;
|
||||
}
|
||||
.alert {
|
||||
padding: 15px !important;
|
||||
margin-bottom: 21px !important;
|
||||
border: 1px solid transparent !important;
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
.alert-danger p {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.footer-link {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#loader {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: none;
|
||||
-ms-flex-wrap: wrap;
|
||||
flex-wrap: wrap;
|
||||
position: absolute;
|
||||
height: 120%;
|
||||
width: 100%;
|
||||
background-color: #efefef;
|
||||
opacity: 0.9;
|
||||
z-index: 10;
|
||||
flex-flow: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
#nb-spinner {
|
||||
width: 75px;
|
||||
height: 75px;
|
||||
margin: 0;
|
||||
background: transparent;
|
||||
border-top: 4px solid #1c856a;
|
||||
border-right: 4px solid transparent;
|
||||
border-radius: 50%;
|
||||
-webkit-animation: 1s spin linear infinite;
|
||||
animation: 1s spin linear infinite;
|
||||
}
|
||||
|
||||
#loader-wrapper {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
#loader-content {
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
-webkit-box-flex: 0;
|
||||
-ms-flex: 0 0 25%;
|
||||
flex: 0 0 25%;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
position: relative;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top: 200px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
@keyframes spin {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
6
assets/theme-entrypoint.js
Normal file
6
assets/theme-entrypoint.js
Normal file
@ -0,0 +1,6 @@
|
||||
import './styles/theme.css'
|
||||
|
||||
import 'altcha';
|
||||
import theme from './theme';
|
||||
|
||||
theme();
|
52
assets/theme.js
Normal file
52
assets/theme.js
Normal file
@ -0,0 +1,52 @@
|
||||
export default function theme() {
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
[].forEach.call(document.querySelectorAll('.language-change'), function(el) {
|
||||
el.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var lang = el.getAttribute('data-lang');
|
||||
if(getCookie('mselang') != lang) {
|
||||
setCookie('mselang', lang, false);
|
||||
location.reload();
|
||||
}
|
||||
return false;
|
||||
})
|
||||
});
|
||||
|
||||
// Empécher le double clic
|
||||
const form = document.forms['login']
|
||||
const loader = document.getElementById('loader');
|
||||
form.addEventListener('submit', function(event) {
|
||||
loader.style.display = 'flex';
|
||||
});
|
||||
});
|
||||
|
||||
function setCookie(name,value,days) {
|
||||
var expires = "";
|
||||
if (days) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + (days*24*60*60*1000));
|
||||
expires = "; expires=" + date.toUTCString();
|
||||
}
|
||||
var temp = window.location.hostname.split('.').reverse();
|
||||
var root_domain = '';
|
||||
for(var i=temp.length - 1;i >= 0;i--){
|
||||
root_domain += temp[i];
|
||||
if(i > 0){
|
||||
root_domain += '.';
|
||||
}
|
||||
}
|
||||
document.cookie = name + "=" + (value || "") + expires + "; path=/; domain=" + root_domain;
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
var nameEQ = name + "=";
|
||||
var ca = document.cookie.split(';');
|
||||
for(var i=0;i < ca.length;i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
||||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user