Skip to content

Commit

Permalink
feat: add pwa generate
Browse files Browse the repository at this point in the history
  • Loading branch information
LeezQ committed Aug 25, 2022
1 parent ef870f4 commit 668df47
Show file tree
Hide file tree
Showing 21 changed files with 7,070 additions and 17,095 deletions.
10 changes: 3 additions & 7 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
"presets": [
"env",
"react"
],
"plugins": [
"transform-class-properties",
"transform-object-rest-spread"
"@babel/preset-env",
"@babel/preset-react"
],
"ignore": [
"./biz/webui/htdocs/src/js/components/json/eval.js"
]
}
}
15 changes: 15 additions & 0 deletions biz/webui/htdocs/index-template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<meta name="google" value="notranslate">
<link rel="shortcut icon" href="img/favicon.ico" />
<title>Whistle Web Debugger</title>
</head>

<body style="overscroll-behavior-x: none;">
<div id="container" class="main"></div>
</body>

</html>
14 changes: 1 addition & 13 deletions biz/webui/htdocs/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="google" value="notranslate">
<link rel="shortcut icon" href="img/favicon.ico" />
<title>Whistle Web Debugger</title>
</head>
<body style="overscroll-behavior-x: none;">
<div id="container" class="main"></div>
<script src="js/index.js?v=2.9.28"></script>
</body>
</html>
<!doctype html><html><head><meta charset="UTF-8"><meta name="google" value="notranslate"><link rel="shortcut icon" href="img/favicon.ico"/><title>Whistle Web Debugger</title><link rel="manifest" href="/js/manifest.cb9af05cae5b19e5f633b935af24d438.json" crossorigin="use-credentials" /></head><body style="overscroll-behavior-x: none;"><div id="container" class="main"></div><script defer="defer" src="js/index-2.9.28.js"></script></body></html>
288 changes: 288 additions & 0 deletions biz/webui/htdocs/js/060b2710bdbbe3dfe48b.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added biz/webui/htdocs/js/4692b9ec53fd5972caa2.ttf
Binary file not shown.
Binary file added biz/webui/htdocs/js/5be1347c682810f199c7.eot
Binary file not shown.
Binary file added biz/webui/htdocs/js/82b1212e45a2bc35dd73.woff
Binary file not shown.
Binary file added biz/webui/htdocs/js/be810be3a3e14c682a25.woff2
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions biz/webui/htdocs/js/index-2.9.28.js

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions biz/webui/htdocs/js/index-2.9.28.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/

/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under the MIT license
*/

/*!
* Sizzle CSS Selector Engine v2.3.3
* https://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2016-08-08
*/

/*!
* jQuery JavaScript Library v3.3.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2018-01-20T17:24Z
*/

/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/

/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
104 changes: 0 additions & 104 deletions biz/webui/htdocs/js/index.js

This file was deleted.

16 changes: 16 additions & 0 deletions biz/webui/htdocs/js/manifest.cb9af05cae5b19e5f633b935af24d438.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"icons": [
{
"src": "/js/icon_192x192.9d3c46155d288f623bd3fc1d272987c3.png",
"sizes": "192x192",
"type": "image/png"
}
],
"name": "Whistle PWA",
"short_name": "Whistle",
"orientation": "portrait",
"display": "standalone",
"start_url": ".",
"description": "HTTP, HTTP2, HTTPS, Websocket debugging proxy",
"background_color": "#fff"
}
1 change: 1 addition & 0 deletions biz/webui/htdocs/js/service-worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions biz/webui/htdocs/js/workbox-ad8011fb.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions biz/webui/htdocs/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ var search = window.location.search;
var hideLeftMenu;
var showTreeView;

if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker
.register('/js/service-worker.js')
.then((registration) => {
console.log('SW registered: ', registration);
})
.catch((registrationError) => {
console.log('SW registration failed: ', registrationError);
});
});
}

if (/[&#?]showTreeView=(0|false|1|true)(?:&|$|#)/.test(search)) {
showTreeView = RegExp.$1 === '1' || RegExp.$1 === 'true';
}
Expand Down
Loading

0 comments on commit 668df47

Please sign in to comment.