-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Create Progressive Web App #4730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a8df308
Create manifest and serviceworker
SohnyBohny cd9dee2
Create templates and add AppSubUrl
SohnyBohny 120ed02
Add JSRenderer
SohnyBohny 928622e
fix ctx type
SohnyBohny 141fa12
Add JSRenderer to static.go
SohnyBohny 6a89184
Merge branch 'master' into create_pwa
techknowlogick b7548db
Complete adding {{AppSubUrl}}
SohnyBohny d4ccf69
Add more fonts to urlsToCache
SohnyBohny 99bdcc9
Add 512px and 192px icons
SohnyBohny 7585872
Merge branch 'master' into create_pwa
techknowlogick 5f86daa
Hardcode font MD5
SohnyBohny 0c99cb5
Default theme doesn't have a specific CSS file
techknowlogick ba2d297
Merge branch 'master' into create_pwa
techknowlogick 98ad135
Merge branch 'master' into create_pwa
lunny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"short_name": "Gitea", | ||
"name": "Gitea - Git with a cup of tea", | ||
"icons": [ | ||
{ | ||
"src": "{{AppSubUrl}}/img/gitea-lg.png", | ||
"type": "image/png", | ||
"sizes": "880x880" | ||
}, | ||
{ | ||
"src": "{{AppSubUrl}}/img/gitea-sm.png", | ||
"type": "image/png", | ||
"sizes": "120x120" | ||
}, | ||
{ | ||
"src": "{{AppSubUrl}}/img/gitea-512.png", | ||
"type": "image/png", | ||
"sizes": "512x512" | ||
}, | ||
{ | ||
"src": "{{AppSubUrl}}/img/gitea-192.png", | ||
"type": "image/png", | ||
"sizes": "192x192" | ||
} | ||
], | ||
"start_url": "{{AppSubUrl}}/", | ||
"scope": "{{AppSubUrl}}/", | ||
"background_color": "#FAFAFA", | ||
"display": "standalone", | ||
"theme_color": "{{ThemeColorMetaTag}}" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
var STATIC_CACHE = 'static-cache-v1'; | ||
var urlsToCache = [ | ||
// js | ||
'{{AppSubUrl}}/vendor/plugins/jquery.areyousure/jquery.are-you-sure.js', | ||
'{{AppSubUrl}}/vendor/plugins/jquery/jquery.min.js', | ||
'{{AppSubUrl}}/vendor/plugins/semantic/semantic.min.js', | ||
'{{AppSubUrl}}/js/index.js?v={{MD5 AppVer}}', | ||
'{{AppSubUrl}}/js/draw.js', | ||
'{{AppSubUrl}}/vendor/plugins/clipboard/clipboard.min.js', | ||
'{{AppSubUrl}}/vendor/plugins/gitgraph/gitgraph.js', | ||
'{{AppSubUrl}}/vendor/plugins/vue/vue.min.js', | ||
'{{AppSubUrl}}/vendor/plugins/emojify/emojify.min.js', | ||
'{{AppSubUrl}}/vendor/plugins/cssrelpreload/loadCSS.min.js', | ||
'{{AppSubUrl}}/vendor/plugins/cssrelpreload/cssrelpreload.min.js', | ||
'{{AppSubUrl}}/vendor/plugins/dropzone/dropzone.js', | ||
'{{AppSubUrl}}/vendor/plugins/highlight/highlight.pack.js', | ||
'{{AppSubUrl}}/vendor/plugins/jquery.datetimepicker/jquery.datetimepicker.js', | ||
'{{AppSubUrl}}/vendor/plugins/jquery.minicolors/jquery.minicolors.min.js', | ||
'{{AppSubUrl}}/vendor/plugins/codemirror/addon/mode/loadmode.js', | ||
'{{AppSubUrl}}/vendor/plugins/codemirror/mode/meta.js', | ||
'{{AppSubUrl}}/vendor/plugins/simplemde/simplemde.min.js', | ||
|
||
// css | ||
'{{AppSubUrl}}/vendor/assets/font-awesome/css/font-awesome.min.css', | ||
'{{AppSubUrl}}/vendor/assets/octicons/octicons.min.css', | ||
'{{AppSubUrl}}/vendor/plugins/simplemde/simplemde.min.css', | ||
'{{AppSubUrl}}/vendor/plugins/gitgraph/gitgraph.css', | ||
'{{AppSubUrl}}/vendor/plugins/tribute/tribute.css', | ||
'{{AppSubUrl}}/vendor/plugins/semantic/semantic.min.css', | ||
'{{AppSubUrl}}/css/index.css?v={{MD5 AppVer}}', | ||
'{{AppSubUrl}}/vendor/plugins/highlight/github.css', | ||
'{{AppSubUrl}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css', | ||
'{{AppSubUrl}}/vendor/plugins/jquery.datetimepicker/jquery.datetimepicker.css', | ||
'{{AppSubUrl}}/vendor/plugins/dropzone/dropzone.css', | ||
'/css/theme-{{DefaultTheme}}.css', | ||
|
||
// img | ||
'{{AppSubUrl}}/img/gitea-sm.png', | ||
'{{AppSubUrl}}/img/gitea-lg.png', | ||
|
||
// fonts | ||
'{{AppSubUrl}}/vendor/plugins/semantic/themes/default/assets/fonts/icons.woff2', | ||
'{{AppSubUrl}}/vendor/assets/octicons/octicons.woff2?ef21c39f0ca9b1b5116e5eb7ac5eabe6', | ||
'{{AppSubUrl}}/vendor/assets/lato-fonts/lato-v14-latin-regular.woff2', | ||
'{{AppSubUrl}}/vendor/assets/lato-fonts/lato-v14-latin-700.woff2' | ||
]; | ||
|
||
self.addEventListener('install', function (event) { | ||
// Perform install steps | ||
event.waitUntil( | ||
caches.open(STATIC_CACHE) | ||
.then(function (cache) { | ||
return cache.addAll(urlsToCache); | ||
}) | ||
); | ||
}); | ||
|
||
self.addEventListener('fetch', function (event) { | ||
event.respondWith( | ||
caches.match(event.request) | ||
.then(function (response) { | ||
// Cache hit - return response | ||
if (response) { | ||
return response; | ||
} | ||
return fetch(event.request); | ||
} | ||
) | ||
); | ||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.