mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-11 11:13:59 +02:00
[ticket/17010] Make webpush js not depend on twig compilation
PHPBB3-17010
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
{% include('ucp_header.html') %}
|
||||
|
||||
{% INCLUDEJS(T_WEBPUSH_JS_PATH) %}
|
||||
{% if NOTIFICATIONS_WEBPUSH_ENABLE %}
|
||||
{% include('ucp_notifications_webpush.html') %}
|
||||
{% endif %}
|
||||
|
||||
<form id="ucp" method="post" action="{{ S_UCP_ACTION }}"{{ S_FORM_ENCTYPE }}>
|
||||
|
||||
|
@@ -0,0 +1,21 @@
|
||||
<script>
|
||||
phpbbWebpushOptions = {
|
||||
serviceWorkerUrl: '{{ U_WEBPUSH_WORKER_URL }}',
|
||||
subscribeUrl: '{{ U_WEBPUSH_SUBSCRIBE }}',
|
||||
unsubscribeUrl: '{{ U_WEBPUSH_UNSUBSCRIBE }}',
|
||||
ajaxErrorTitle: '{{ lang('AJAX_ERROR_TITLE') }}',
|
||||
vapidPublicKey: '{{ VAPID_PUBLIC_KEY }}',
|
||||
formTokens: {
|
||||
creationTime: '{{ WEBPUSH_FORM_TOKENS.creation_time }}',
|
||||
formToken: '{{ WEBPUSH_FORM_TOKENS.form_token }}',
|
||||
},
|
||||
subscriptions: [
|
||||
{% for sub in SUBSCRIPTIONS %}
|
||||
{endpoint: '{{ sub.endpoint }}', expiration: '{{ sub.expiration }}' },
|
||||
{% endfor %}
|
||||
],
|
||||
}
|
||||
</script>
|
||||
|
||||
{% INCLUDEJS(T_ASSETS_PATH ~ '/javascript/webpush.js') %}
|
||||
|
Reference in New Issue
Block a user