Cookie consent popup instead of dialog.

This commit is contained in:
kovacsv 2021-12-10 18:51:05 +01:00
parent 9c803562f3
commit 9986664a31
7 changed files with 35 additions and 38 deletions

View File

@ -77,7 +77,6 @@
"website/o3dv/js/openurldialog.js",
"website/o3dv/js/exportdialog.js",
"website/o3dv/js/sharingdialog.js",
"website/o3dv/js/cookiedialog.js",
"website/o3dv/js/panelset.js",
"website/o3dv/js/navigatoritems.js",
"website/o3dv/js/navigatorpanel.js",

View File

@ -105,7 +105,6 @@
<script type="text/javascript" src="o3dv/js/openurldialog.js"></script>
<script type="text/javascript" src="o3dv/js/exportdialog.js"></script>
<script type="text/javascript" src="o3dv/js/sharingdialog.js"></script>
<script type="text/javascript" src="o3dv/js/cookiedialog.js"></script>
<script type="text/javascript" src="o3dv/js/panelset.js"></script>
<script type="text/javascript" src="o3dv/js/navigatoritems.js"></script>
<script type="text/javascript" src="o3dv/js/navigatorpanel.js"></script>

View File

@ -107,7 +107,6 @@
<script type="text/javascript" src="o3dv/js/openurldialog.js"></script>
<script type="text/javascript" src="o3dv/js/exportdialog.js"></script>
<script type="text/javascript" src="o3dv/js/sharingdialog.js"></script>
<script type="text/javascript" src="o3dv/js/cookiedialog.js"></script>
<script type="text/javascript" src="o3dv/js/panelset.js"></script>
<script type="text/javascript" src="o3dv/js/navigatoritems.js"></script>
<script type="text/javascript" src="o3dv/js/navigatorpanel.js"></script>

View File

@ -247,6 +247,30 @@ div.ov_property_table div.ov_property_table_button
cursor: pointer;
}
div.ov_bottom_floating_panel
{
background: var(--ov_background_color);
border-top: 1px solid var(--ov_border_color);
width: 100%;
padding: 30px;
box-sizing: border-box;
position: absolute;
bottom: 0px;
}
div.ov_bottom_floating_panel div.ov_floating_panel_text
{
padding: 3px;
margin-bottom: 10px;
float: left;
}
div.ov_bottom_floating_panel div.ov_floating_panel_button
{
width: 120px;
float: right;
}
@media (hover)
{
@ -293,6 +317,11 @@ div.ov_progress
max-width: 80%;
}
div.ov_bottom_floating_panel
{
padding: 10px;
}
}
@media only screen and (max-height: 700px)

View File

@ -1,20 +0,0 @@
OV.ShowCookieDialog = function (onAccept)
{
let dialog = new OV.ButtonDialog ();
let contentDiv = dialog.Init ('Cookie Consent', [
{
name : 'Accept',
onClick () {
dialog.Hide ();
onAccept ();
}
}
]);
let text = 'This website uses cookies to offer you better user experience. See the details at the <a target="_blank" href="info/cookies.html">Cookies Policy</a> page.';
OV.AddDiv (contentDiv, 'ov_dialog_section', text);
dialog.SetCloseable (false);
dialog.Show ();
dialog.MoveToTop ();
return dialog;
};

View File

@ -72,15 +72,6 @@ OV.Modal = class
this.isOpen = false;
}
MoveToTop ()
{
if (!this.isOpen) {
return;
}
this.modalDiv.style.zIndex = '1000';
this.overlayDiv.style.zIndex = '1000';
}
IsOpen ()
{
return this.isOpen;
@ -138,11 +129,6 @@ OV.Dialog = class
{
this.modal.Close ();
}
MoveToTop ()
{
this.modal.MoveToTop ();
}
};
OV.ProgressDialog = class extends OV.Dialog

View File

@ -685,8 +685,13 @@ OV.Website = class
return;
}
OV.ShowCookieDialog (() => {
let text = 'This website uses cookies to offer you better user experience. See the details at the <a target="_blank" href="info/cookies.html">Cookies Policy</a> page.';
let popupDiv = OV.AddDiv (document.body, 'ov_bottom_floating_panel');
OV.AddDiv (popupDiv, 'ov_floating_panel_text', text);
let acceptButton = OV.AddDiv (popupDiv, 'ov_button ov_floating_panel_button', 'Accept');
acceptButton.addEventListener ('click', () => {
this.cookieHandler.SetBoolVal ('ov_cookie_consent', true);
popupDiv.remove ();
});
}
};