Add files via upload
This commit is contained in:
parent
c67c7e3a1f
commit
274bc75798
1 changed files with 41 additions and 0 deletions
41
ui.min.js
vendored
41
ui.min.js
vendored
|
@ -5098,4 +5098,45 @@ var ratio = w/ow
|
|||
divms.height = h * ratio +"px"
|
||||
divms.transform="scale("+ratio+")"
|
||||
divms.transformOrigin="0 0";
|
||||
}
|
||||
|
||||
go_PWA()
|
||||
|
||||
function go_PWA()
|
||||
{
|
||||
var href = window.location.href
|
||||
var url = href.substring(0, href.lastIndexOf('/')) + "/";
|
||||
|
||||
var theme_color = "#ffffff"
|
||||
if($('HTML')[0].classList.contains('dark-mode'))
|
||||
theme_color = "#000000"
|
||||
|
||||
var myDynamicManifest = {
|
||||
"name": "RounCube",
|
||||
theme_color: theme_color,
|
||||
"start_url": url,
|
||||
"icons": [{
|
||||
"src": url+"/skins/elastic2022/images/rc192x192.png",
|
||||
"sizes": "192x192",
|
||||
"purpose": "maskable",
|
||||
"purpose": "any"},{
|
||||
"src": url+"/skins/elastic2022/images/rc512x512.png",
|
||||
"sizes": "512x512",
|
||||
"purpose": "maskable",
|
||||
"purpose": "any"
|
||||
}],
|
||||
"display": "standalone",
|
||||
}
|
||||
const stringManifest = JSON.stringify(myDynamicManifest);
|
||||
const blob = new Blob([stringManifest], {type: 'application/json'});
|
||||
|
||||
|
||||
let reader = new FileReader();
|
||||
reader.readAsDataURL(blob);
|
||||
reader.onload = function(){
|
||||
var link = document.createElement('link');
|
||||
link.href = reader.result
|
||||
link.rel = 'manifest';
|
||||
document.getElementsByTagName('head')[0].appendChild(link);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue