mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Added Progressive Web App support for Etherpad (#6411)
This commit is contained in:
parent
2e12906ff5
commit
f1a1b6bfd7
7 changed files with 45 additions and 8 deletions
12
src/ep.json
12
src/ep.json
|
@ -57,6 +57,12 @@
|
||||||
"expressCreateServer": "ep_etherpad-lite/node/hooks/express/padurlsanitize"
|
"expressCreateServer": "ep_etherpad-lite/node/hooks/express/padurlsanitize"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "pwa",
|
||||||
|
"hooks": {
|
||||||
|
"expressCreateServer": "ep_etherpad-lite/node/hooks/express/pwa"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "apicalls",
|
"name": "apicalls",
|
||||||
"hooks": {
|
"hooks": {
|
||||||
|
@ -112,12 +118,6 @@
|
||||||
"hooks": {
|
"hooks": {
|
||||||
"expressPreSession": "ep_etherpad-lite/node/hooks/express/openapi"
|
"expressPreSession": "ep_etherpad-lite/node/hooks/express/openapi"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ep_message_all",
|
|
||||||
"client_hooks": {
|
|
||||||
"handleClientMessage_shoutMessage": "ep_etherpad-lite/static/js/messageHandler"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
32
src/node/hooks/express/pwa.ts
Normal file
32
src/node/hooks/express/pwa.ts
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
import {ArgsExpressType} from "../../types/ArgsExpressType";
|
||||||
|
const settings = require('../../utils/Settings');
|
||||||
|
|
||||||
|
const pwa = {
|
||||||
|
name: settings.title || "Etherpad",
|
||||||
|
short_name: settings.title,
|
||||||
|
description: "A collaborative online editor",
|
||||||
|
icons: [
|
||||||
|
{
|
||||||
|
"src": "/static/skins/colibris/images/fond.jpg",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/favicon.ico",
|
||||||
|
"sizes": "64x64 32x32 24x24 16x16",
|
||||||
|
type: "image/png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
start_url: "/",
|
||||||
|
display: "fullscreen",
|
||||||
|
theme_color: "#0f775b",
|
||||||
|
background_color: "#0f775b"
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.expressCreateServer = (hookName:string, args:ArgsExpressType, cb:Function) => {
|
||||||
|
args.app.get('/manifest.json', (req:any, res:any) => {
|
||||||
|
res.json(pwa);
|
||||||
|
});
|
||||||
|
|
||||||
|
return cb();
|
||||||
|
}
|
|
@ -2,7 +2,8 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title><%- padId %></title>
|
<title><%- padId %></title>
|
||||||
<meta name="generator" content="Etherpad"/>
|
<link rel="manifest" href="/manifest.json" />
|
||||||
|
<meta name="generator" content="Etherpad"/>
|
||||||
<meta name="author" content="Etherpad"/>
|
<meta name="author" content="Etherpad"/>
|
||||||
<meta name="changedby" content="Etherpad"/>
|
<meta name="changedby" content="Etherpad"/>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
<title><%=settings.title%></title>
|
<title><%=settings.title%></title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
<link rel="manifest" href="/manifest.json" />
|
||||||
<meta name="referrer" content="no-referrer">
|
<meta name="referrer" content="no-referrer">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
||||||
<link rel="shortcut icon" href="favicon.ico">
|
<link rel="shortcut icon" href="favicon.ico">
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>JavaScript license information</title>
|
<title>JavaScript license information</title>
|
||||||
|
<link rel="manifest" href="/manifest.json" />
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<% e.begin_block("htmlHead"); %>
|
<% e.begin_block("htmlHead"); %>
|
||||||
<% e.end_block(); %>
|
<% e.end_block(); %>
|
||||||
<title><%=settings.title%></title>
|
<title><%=settings.title%></title>
|
||||||
|
<link rel="manifest" href="/manifest.json" />
|
||||||
<script>
|
<script>
|
||||||
/*
|
/*
|
||||||
|@licstart The following is the entire license notice for the
|
|@licstart The following is the entire license notice for the
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
</script>
|
</script>
|
||||||
<script src="../../static/js/basic_error_handler.js?v=<%=settings.randomVersionString%>"></script>
|
<script src="../../static/js/basic_error_handler.js?v=<%=settings.randomVersionString%>"></script>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
<link rel="manifest" href="/manifest.json" />
|
||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
<meta name="referrer" content="no-referrer">
|
<meta name="referrer" content="no-referrer">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue