├── .DS_Store ├── .eslintrc.js ├── .gitignore ├── .vscode └── settings.json ├── module1 ├── .DS_Store ├── code │ ├── .DS_Store │ ├── .browserslistrc │ ├── .eslintrc.js │ ├── .prettierrc │ ├── README.md │ ├── babel.config.js │ ├── dist │ │ ├── css │ │ │ ├── app.f58081d4.css │ │ │ ├── arraysort.db104730.css │ │ │ ├── clipboard.efa73993.css │ │ │ ├── fishTemplate.79bb0d04.css │ │ │ ├── imageGrid.08fbcfd1.css │ │ │ ├── lab.0113e898.css │ │ │ ├── lasyImage.546970c4.css │ │ │ ├── shortUrl.92f91115.css │ │ │ ├── siteTheme.less │ │ │ ├── voiceChat.a3ddc181.css │ │ │ └── webRTCScreenShot.3c7b479f.css │ │ ├── favicon.ico │ │ ├── img │ │ │ └── icons │ │ │ │ ├── android-chrome-192x192.png │ │ │ │ ├── android-chrome-512x512.png │ │ │ │ ├── android-chrome-maskable-192x192.png │ │ │ │ ├── android-chrome-maskable-512x512.png │ │ │ │ ├── apple-touch-icon-120x120.png │ │ │ │ ├── apple-touch-icon-152x152.png │ │ │ │ ├── apple-touch-icon-180x180.png │ │ │ │ ├── apple-touch-icon-60x60.png │ │ │ │ ├── apple-touch-icon-76x76.png │ │ │ │ ├── apple-touch-icon.png │ │ │ │ ├── favicon-16x16.png │ │ │ │ ├── favicon-32x32.png │ │ │ │ ├── msapplication-icon-144x144.png │ │ │ │ ├── mstile-150x150.png │ │ │ │ └── safari-pinned-tab.svg │ │ ├── index.html │ │ ├── js │ │ │ ├── app.229eb4fc.js │ │ │ ├── app.229eb4fc.js.map │ │ │ ├── arraysort.1f1299ae.js │ │ │ ├── arraysort.1f1299ae.js.map │ │ │ ├── bitmask.4e51a1ff.js │ │ │ ├── bitmask.4e51a1ff.js.map │ │ │ ├── catDomNode.a0513013.js │ │ │ ├── catDomNode.a0513013.js.map │ │ │ ├── chunk-vendors.502cd973.js │ │ │ ├── chunk-vendors.502cd973.js.map │ │ │ ├── clipboard.868726fd.js │ │ │ ├── clipboard.868726fd.js.map │ │ │ ├── fishTemplate.2fbb5fa8.js │ │ │ ├── fishTemplate.2fbb5fa8.js.map │ │ │ ├── fishTemplate~lab.dda2a25e.js │ │ │ ├── fishTemplate~lab.dda2a25e.js.map │ │ │ ├── geolocation.0f86e016.js │ │ │ ├── geolocation.0f86e016.js.map │ │ │ ├── imageGrid.57cba897.js │ │ │ ├── imageGrid.57cba897.js.map │ │ │ ├── keyboard.d3e2a7f8.js │ │ │ ├── keyboard.d3e2a7f8.js.map │ │ │ ├── lab.bb415a4b.js │ │ │ ├── lab.bb415a4b.js.map │ │ │ ├── lasyImage.34d97363.js │ │ │ ├── lasyImage.34d97363.js.map │ │ │ ├── shortUrl.aef8b268.js │ │ │ ├── shortUrl.aef8b268.js.map │ │ │ ├── voiceChat.005b21ad.js │ │ │ ├── voiceChat.005b21ad.js.map │ │ │ ├── webRTCScreenShot.0248bb1e.js │ │ │ ├── webRTCScreenShot.0248bb1e.js.map │ │ │ ├── webWorker.c7f22eea.js │ │ │ └── webWorker.c7f22eea.js.map │ │ ├── manifest.json │ │ ├── precache-manifest.cb6f91914d796530ce8f2c6552c5c312.js │ │ ├── robots.txt │ │ ├── sw.js │ │ └── workbox-v4.3.1 │ │ │ ├── workbox-background-sync.dev.js │ │ │ ├── workbox-background-sync.dev.js.map │ │ │ ├── workbox-background-sync.prod.js │ │ │ ├── workbox-background-sync.prod.js.map │ │ │ ├── workbox-broadcast-update.dev.js │ │ │ ├── workbox-broadcast-update.dev.js.map │ │ │ ├── workbox-broadcast-update.prod.js │ │ │ ├── workbox-broadcast-update.prod.js.map │ │ │ ├── workbox-cacheable-response.dev.js │ │ │ ├── workbox-cacheable-response.dev.js.map │ │ │ ├── workbox-cacheable-response.prod.js │ │ │ ├── workbox-cacheable-response.prod.js.map │ │ │ ├── workbox-core.dev.js │ │ │ ├── workbox-core.dev.js.map │ │ │ ├── workbox-core.prod.js │ │ │ ├── workbox-core.prod.js.map │ │ │ ├── workbox-expiration.dev.js │ │ │ ├── workbox-expiration.dev.js.map │ │ │ ├── workbox-expiration.prod.js │ │ │ ├── workbox-expiration.prod.js.map │ │ │ ├── workbox-navigation-preload.dev.js │ │ │ ├── workbox-navigation-preload.dev.js.map │ │ │ ├── workbox-navigation-preload.prod.js │ │ │ ├── workbox-navigation-preload.prod.js.map │ │ │ ├── workbox-offline-ga.dev.js │ │ │ ├── workbox-offline-ga.dev.js.map │ │ │ ├── workbox-offline-ga.prod.js │ │ │ ├── workbox-offline-ga.prod.js.map │ │ │ ├── workbox-precaching.dev.js │ │ │ ├── workbox-precaching.dev.js.map │ │ │ ├── workbox-precaching.prod.js │ │ │ ├── workbox-precaching.prod.js.map │ │ │ ├── workbox-range-requests.dev.js │ │ │ ├── workbox-range-requests.dev.js.map │ │ │ ├── workbox-range-requests.prod.js │ │ │ ├── workbox-range-requests.prod.js.map │ │ │ ├── workbox-routing.dev.js │ │ │ ├── workbox-routing.dev.js.map │ │ │ ├── workbox-routing.prod.js │ │ │ ├── workbox-routing.prod.js.map │ │ │ ├── workbox-strategies.dev.js │ │ │ ├── workbox-strategies.dev.js.map │ │ │ ├── workbox-strategies.prod.js │ │ │ ├── workbox-strategies.prod.js.map │ │ │ ├── workbox-streams.dev.js │ │ │ ├── workbox-streams.dev.js.map │ │ │ ├── workbox-streams.prod.js │ │ │ ├── workbox-streams.prod.js.map │ │ │ ├── workbox-sw.js │ │ │ ├── workbox-sw.js.map │ │ │ ├── workbox-window.dev.es5.mjs │ │ │ ├── workbox-window.dev.es5.mjs.map │ │ │ ├── workbox-window.dev.mjs │ │ │ ├── workbox-window.dev.mjs.map │ │ │ ├── workbox-window.dev.umd.js │ │ │ ├── workbox-window.dev.umd.js.map │ │ │ ├── workbox-window.prod.es5.mjs │ │ │ ├── workbox-window.prod.es5.mjs.map │ │ │ ├── workbox-window.prod.mjs │ │ │ ├── workbox-window.prod.mjs.map │ │ │ ├── workbox-window.prod.umd.js │ │ │ └── workbox-window.prod.umd.js.map │ ├── jest.config.js │ ├── package.json │ ├── public │ │ ├── css │ │ │ └── siteTheme.less │ │ ├── favicon.ico │ │ ├── img │ │ │ └── icons │ │ │ │ ├── android-chrome-192x192.png │ │ │ │ ├── android-chrome-512x512.png │ │ │ │ ├── android-chrome-maskable-192x192.png │ │ │ │ ├── android-chrome-maskable-512x512.png │ │ │ │ ├── apple-touch-icon-120x120.png │ │ │ │ ├── apple-touch-icon-152x152.png │ │ │ │ ├── apple-touch-icon-180x180.png │ │ │ │ ├── apple-touch-icon-60x60.png │ │ │ │ ├── apple-touch-icon-76x76.png │ │ │ │ ├── apple-touch-icon.png │ │ │ │ ├── favicon-16x16.png │ │ │ │ ├── favicon-32x32.png │ │ │ │ ├── msapplication-icon-144x144.png │ │ │ │ ├── mstile-150x150.png │ │ │ │ └── safari-pinned-tab.svg │ │ ├── index.html │ │ └── robots.txt │ ├── server.js │ ├── src │ │ ├── .DS_Store │ │ ├── App.vue │ │ ├── assets │ │ │ └── logo.png │ │ ├── components │ │ │ ├── .DS_Store │ │ │ ├── CatNode │ │ │ │ └── index.vue │ │ │ ├── FishTemplate │ │ │ │ ├── components │ │ │ │ │ └── NewsList.js │ │ │ │ ├── engine.js │ │ │ │ ├── engine2.js │ │ │ │ ├── index.js │ │ │ │ ├── v1.js │ │ │ │ ├── v2.js │ │ │ │ └── vnode.js │ │ │ └── LasyImage.vue │ │ ├── main.js │ │ ├── router │ │ │ └── index.js │ │ ├── serviceworker.js │ │ └── views │ │ │ ├── ArraySort.vue │ │ │ ├── BitMask.vue │ │ │ ├── CatDomNode.vue │ │ │ ├── Clipboard.vue │ │ │ ├── Clock.worker.js │ │ │ ├── FishTemplate.vue │ │ │ ├── FloatToBinary.vue │ │ │ ├── Geolocation.vue │ │ │ ├── Home.vue │ │ │ ├── ImageGrid.vue │ │ │ ├── IndexedDB.vue │ │ │ ├── Keyboard.vue │ │ │ ├── Lab.vue │ │ │ ├── LasyImage.vue │ │ │ ├── LessTheme.vue │ │ │ ├── Memory.vue │ │ │ ├── SeviceWorker.vue │ │ │ ├── ShortURL.vue │ │ │ ├── VoiceChat.vue │ │ │ ├── WebRTC.vue │ │ │ ├── WebRTCScreenShot.vue │ │ │ └── WebWorker.vue │ ├── tests │ │ └── unit │ │ │ ├── engine2.spec.js │ │ │ └── vnode.spec.js │ ├── vue.config.js │ └── yarn.lock ├── mvvm │ ├── .DS_Store │ ├── component │ │ └── Todo.js │ ├── core │ │ ├── Func.js │ │ ├── Rv.js │ │ ├── Vnode.js │ │ ├── index.js │ │ └── render.js │ ├── index.html │ ├── package.json │ ├── server.js │ └── yarn.lock └── pwa │ ├── .browserslistrc │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── jest.config.js │ ├── package.json │ ├── public │ ├── favicon.ico │ └── index.html │ ├── src │ ├── App.vue │ ├── assets │ │ └── logo.png │ ├── components │ │ └── HelloWorld.vue │ └── main.js │ ├── tests │ └── unit │ │ └── example.spec.js │ ├── vue.config.js │ └── yarn.lock └── yarn.lock /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/.DS_Store -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true, 5 | }, 6 | extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"], 7 | parserOptions: { 8 | parser: "babel-eslint", 9 | }, 10 | rules: { 11 | "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", 12 | "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", 13 | }, 14 | overrides: [ 15 | { 16 | files: [ 17 | "**/__tests__/*.{j,t}s?(x)", 18 | "**/tests/unit/**/*.spec.{j,t}s?(x)", 19 | ], 20 | env: { 21 | jest: true, 22 | }, 23 | }, 24 | ], 25 | }; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "git.ignoreLimitWarning": true, 3 | "editor.formatOnSave": true, 4 | "files.autoSaveDelay": 3000 5 | } -------------------------------------------------------------------------------- /module1/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/.DS_Store -------------------------------------------------------------------------------- /module1/code/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/.DS_Store -------------------------------------------------------------------------------- /module1/code/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | -------------------------------------------------------------------------------- /module1/code/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true, 5 | }, 6 | extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"], 7 | parserOptions: { 8 | parser: "babel-eslint", 9 | }, 10 | rules: { 11 | "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", 12 | "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", 13 | }, 14 | overrides: [ 15 | { 16 | files: [ 17 | "**/__tests__/*.{j,t}s?(x)", 18 | "**/tests/unit/**/*.spec.{j,t}s?(x)", 19 | ], 20 | env: { 21 | jest: true, 22 | }, 23 | }, 24 | ], 25 | }; 26 | -------------------------------------------------------------------------------- /module1/code/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "eslintIntegration": true, 3 | "stylelintIntegration": true, 4 | "tabWidth": 2, 5 | "singleQuote": false, 6 | "semi": true 7 | } 8 | -------------------------------------------------------------------------------- /module1/code/README.md: -------------------------------------------------------------------------------- 1 | # main 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn run build 16 | ``` 17 | 18 | ### Run your tests 19 | ``` 20 | yarn run test 21 | ``` 22 | 23 | ### Lints and fixes files 24 | ``` 25 | yarn run lint 26 | ``` 27 | 28 | ### Run your unit tests 29 | ``` 30 | yarn run test:unit 31 | ``` 32 | 33 | ### Customize configuration 34 | See [Configuration Reference](https://cli.vuejs.org/config/). 35 | -------------------------------------------------------------------------------- /module1/code/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ["@vue/cli-plugin-babel/preset"], 3 | }; 4 | -------------------------------------------------------------------------------- /module1/code/dist/css/app.f58081d4.css: -------------------------------------------------------------------------------- 1 | *{box-sizing:border-box;margin:0;padding:0}#app,body,html{height:100%}#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50}#app .btn{display:inline-block;border-radius:6px;width:200px;height:60px;line-height:60px;margin-left:10px;background-color:#f5a87c;color:#fff;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#app .card{padding:20px}#app .text{height:40px;line-height:40px;text-indent:10px;min-width:300px}.head[data-v-be704062]{background-color:#5666f3;color:#fff;font-size:30px;height:50px;line-height:50px}.menu[data-v-be704062]{display:flex;align-items:center;flex-wrap:wrap}.menu .item[data-v-be704062]{display:flex;border:1px solid #e0e0e0;background:#f0f0f0;width:200px;height:100px;align-items:center;justify-content:center;margin:10px;border-radius:6px} -------------------------------------------------------------------------------- /module1/code/dist/css/arraysort.db104730.css: -------------------------------------------------------------------------------- 1 | .btn{display:flex;align-items:center;justify-content:center;width:100px;height:40px;background:#90ee90;margin:10px;cursor:pointer} -------------------------------------------------------------------------------- /module1/code/dist/css/clipboard.efa73993.css: -------------------------------------------------------------------------------- 1 | .page[data-v-d2ddcf1c]{text-align:left}.page section[data-v-d2ddcf1c]{margin:20px}.page img[data-v-d2ddcf1c]{border:1px solid #ccc} -------------------------------------------------------------------------------- /module1/code/dist/css/fishTemplate.79bb0d04.css: -------------------------------------------------------------------------------- 1 | .news-item{display:flex;width:600px;height:100px;justify-content:space-between} -------------------------------------------------------------------------------- /module1/code/dist/css/imageGrid.08fbcfd1.css: -------------------------------------------------------------------------------- 1 | .grid-box[data-v-83ee4e46]{display:grid;grid-template-columns:200px 200px 200px 200px;grid-template-rows:repeat(auto-fill,200px);-moz-column-gap:10px;column-gap:10px;row-gap:10px;grid-auto-flow:row}.grid-box .big-item[data-v-83ee4e46]{grid-column:span 2;grid-row:span 2;border:2px solid red;background:red}.grid-box .big-item img[data-v-83ee4e46]{width:100%;height:100%}.grid-box .big-item1[data-v-83ee4e46]{grid-column-start:1;grid-column-end:3;grid-row:span 2;border:2px solid red;background:red}.grid-box .big-item1 img[data-v-83ee4e46]{width:100%;height:100%}.grid-box .big-item2[data-v-83ee4e46]{grid-column-start:2;grid-column-end:4;grid-row:span 2;border:2px solid red;background:red}.grid-box .big-item2 img[data-v-83ee4e46]{width:100%;height:100%}.grid-box .big-item3[data-v-83ee4e46]{grid-column-start:3;grid-column-end:5;grid-row:span 2;border:2px solid red;background:red}.grid-box .big-item3 img[data-v-83ee4e46]{width:100%;height:100%}.grid-box .big-item4[data-v-83ee4e46]{grid-column-start:3;grid-column-end:5;grid-row:span 2;border:2px solid red;background:red}.grid-box .big-item4 img[data-v-83ee4e46]{width:100%;height:100%} -------------------------------------------------------------------------------- /module1/code/dist/css/lab.0113e898.css: -------------------------------------------------------------------------------- 1 | .head{display:flex;text-align:right;justify-content:flex-end}.head .theme{width:80px;height:30px;line-height:30px;background:#ccc;text-align:center;cursor:pointer;color:#fff}.colorDialog{display:grid;width:320px;height:120px;grid-template-columns:repeat(8,40px);grid-template-rows:repeat(auto-fill,40px);cursor:pointer;border:1px solid #ccc;position:fixed;top:30px;right:10px}.colorDialog .color:hover{border:1px solid #000} -------------------------------------------------------------------------------- /module1/code/dist/css/lasyImage.546970c4.css: -------------------------------------------------------------------------------- 1 | .out-scroll[data-v-5a306725]{overflow:auto;width:400px;border:1px solid red;margin-left:200px;height:600px;background:#ccc}.out-scroll .middle-scroll[data-v-5a306725]{margin-top:1000px;height:1000px;overflow:auto;background:#999}.out-scroll .middle-scroll .place-holder[data-v-5a306725]{height:3000px;background:#444} -------------------------------------------------------------------------------- /module1/code/dist/css/shortUrl.92f91115.css: -------------------------------------------------------------------------------- 1 | .shortURL[data-v-3d3935ee]{width:100%}.shortURL .tool[data-v-3d3935ee]{text-align:right;padding:10px 20px}.shortURL .input[data-v-3d3935ee]{font-size:24px;display:flex;justify-content:center;align-items:center;height:400px}.shortURL .input input[data-v-3d3935ee]{width:400px;height:60px;font-size:24px;text-indent:10px} -------------------------------------------------------------------------------- /module1/code/dist/css/siteTheme.less: -------------------------------------------------------------------------------- 1 | @themeColor: #c1cbd7; 2 | 3 | #blog { 4 | min-height: 100%; 5 | display: grid; 6 | grid-template-columns: 200px auto; 7 | grid-template-rows: 100px auto 100px; 8 | 9 | .head { 10 | grid-column: span 2; 11 | background-color: @themeColor; 12 | } 13 | .left { 14 | background-color: fade(@themeColor, 30%); 15 | } 16 | .footer { 17 | grid-column: span 2; 18 | background-color: darken(@themeColor, 50%); 19 | color: lighten(@themeColor, 50%); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /module1/code/dist/css/voiceChat.a3ddc181.css: -------------------------------------------------------------------------------- 1 | .chatroom[data-v-24a0996e]{position:relative;border:1px solid #ccc;width:650px}.chatroom .roomUrl[data-v-24a0996e]{width:500px}.chatroom #remoteVideo[data-v-24a0996e]{position:absolute;right:10px;top:20px;z-index:10} -------------------------------------------------------------------------------- /module1/code/dist/css/webRTCScreenShot.3c7b479f.css: -------------------------------------------------------------------------------- 1 | .screenShot[data-v-399024f6]{display:flex;position:relative;border:1px solid #ccc;width:650px;height:540px} -------------------------------------------------------------------------------- /module1/code/dist/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/dist/favicon.ico -------------------------------------------------------------------------------- /module1/code/dist/img/icons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/dist/img/icons/android-chrome-192x192.png -------------------------------------------------------------------------------- /module1/code/dist/img/icons/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/dist/img/icons/android-chrome-512x512.png -------------------------------------------------------------------------------- /module1/code/dist/img/icons/android-chrome-maskable-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/dist/img/icons/android-chrome-maskable-192x192.png -------------------------------------------------------------------------------- /module1/code/dist/img/icons/android-chrome-maskable-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/dist/img/icons/android-chrome-maskable-512x512.png -------------------------------------------------------------------------------- /module1/code/dist/img/icons/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/dist/img/icons/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /module1/code/dist/img/icons/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/dist/img/icons/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /module1/code/dist/img/icons/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/dist/img/icons/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /module1/code/dist/img/icons/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/dist/img/icons/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /module1/code/dist/img/icons/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/dist/img/icons/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /module1/code/dist/img/icons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/dist/img/icons/apple-touch-icon.png -------------------------------------------------------------------------------- /module1/code/dist/img/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/dist/img/icons/favicon-16x16.png -------------------------------------------------------------------------------- /module1/code/dist/img/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/dist/img/icons/favicon-32x32.png -------------------------------------------------------------------------------- /module1/code/dist/img/icons/msapplication-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/dist/img/icons/msapplication-icon-144x144.png -------------------------------------------------------------------------------- /module1/code/dist/img/icons/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/dist/img/icons/mstile-150x150.png -------------------------------------------------------------------------------- /module1/code/dist/img/icons/safari-pinned-tab.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /module1/code/dist/index.html: -------------------------------------------------------------------------------- 1 | main
-------------------------------------------------------------------------------- /module1/code/dist/js/arraysort.1f1299ae.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["arraysort"],{"04d1":function(r,t,n){var o=n("342f"),e=o.match(/firefox\/(\d+)/i);r.exports=!!e&&+e[1]},"3a80":function(r,t,n){"use strict";n.r(t);var o=function(){var r=this,t=r.$createElement,n=r._self._c||t;return n("div",{staticClass:"arraySort"},[r._v(" ArraySort "),n("hr"),n("a",{staticClass:"btn",on:{click:r.createArray}},[r._v("生成数组")]),n("a",{staticClass:"btn",on:{click:r.startSort}},[r._v("开始排序")]),n("div",[r._v(r._s(r.array.toString()))]),n("div",[r._v("快速排序:"+r._s(r.quickSortTime))]),n("div",[r._v("sort:"+r._s(r.sortTime))])])},e=[],i=(n("4e82"),{name:"ArraySort",data:function(){return{array:[],quickSortTime:0,sortTime:0}},methods:{startSort:function(){var r=performance.now();console.log(this.array.sort((function(r,t){return r-t}))),this.sortTime=performance.now()-r,r=performance.now(),console.log(this.quickSort(this.array,0,this.array.length)),this.quickSortTime=performance.now()-r},createArray:function(){for(var r=5e3,t=0;t3)){if(l)return!0;if(v)return v<603;var r,t,n,o,e="";for(r=65;r<76;r++){switch(t=String.fromCharCode(r),r){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(o=0;o<47;o++)d.push({k:t+o,v:n})}for(d.sort((function(r,t){return t.v-r.v})),o=0;oString(n)?1:-1}};o({target:"Array",proto:!0,forced:b},{sort:function(r){void 0!==r&&e(r);var t=i(this);if(g)return void 0===r?p.call(t):p.call(t,r);var n,o,c=[],u=a(t.length);for(o=0;o0)r[o]=r[--o];o!==i++&&(r[o]=n)}return r},i=function(r,t,n){var o=r.length,e=t.length,i=0,a=0,c=[];while(i-1:e.query},on:{change:function(r){var i=e.query,n=r.target,t=!!n.checked;if(Array.isArray(i)){var a="",s=e._i(i,a);n.checked?s<0&&(e.query=i.concat([a])):s>-1&&(e.query=i.slice(0,s).concat(i.slice(s+1)))}else e.query=t}}}),e._v("查询 ")]),i("label",[i("input",{directives:[{name:"model",rawName:"v-model",value:e.insert,expression:"insert"}],attrs:{type:"checkbox",value:""},domProps:{checked:Array.isArray(e.insert)?e._i(e.insert,"")>-1:e.insert},on:{change:function(r){var i=e.insert,n=r.target,t=!!n.checked;if(Array.isArray(i)){var a="",s=e._i(i,a);n.checked?s<0&&(e.insert=i.concat([a])):s>-1&&(e.insert=i.slice(0,s).concat(i.slice(s+1)))}else e.insert=t}}}),e._v("增加 ")]),i("label",[i("input",{directives:[{name:"model",rawName:"v-model",value:e.remove,expression:"remove"}],attrs:{type:"checkbox",value:""},domProps:{checked:Array.isArray(e.remove)?e._i(e.remove,"")>-1:e.remove},on:{change:function(r){var i=e.remove,n=r.target,t=!!n.checked;if(Array.isArray(i)){var a="",s=e._i(i,a);n.checked?s<0&&(e.remove=i.concat([a])):s>-1&&(e.remove=i.slice(0,s).concat(i.slice(s+1)))}else e.remove=t}}}),e._v("删除 ")]),i("label",[i("input",{directives:[{name:"model",rawName:"v-model",value:e.update,expression:"update"}],attrs:{type:"checkbox",value:""},domProps:{checked:Array.isArray(e.update)?e._i(e.update,"")>-1:e.update},on:{change:function(r){var i=e.update,n=r.target,t=!!n.checked;if(Array.isArray(i)){var a="",s=e._i(i,a);n.checked?s<0&&(e.update=i.concat([a])):s>-1&&(e.update=i.slice(0,s).concat(i.slice(s+1)))}else e.update=t}}}),e._v("更新 ")])]),i("section",[e._v("权限值:"+e._s(e.permission.flag))])])},t=[],a=i("d4ec"),s=i("bee2");function o(e,r,i){return r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}var c=function(){function e(){Object(a["a"])(this,e),this.flag=0}return Object(s["a"])(e,[{key:"setPermission",value:function(e){this.flag=e}},{key:"enable",value:function(e){this.flag|=e}},{key:"disable",value:function(e){this.flag&=~e}},{key:"isAllow",value:function(e){return(this.flag&e)==e}},{key:"isNotAllow",value:function(e){return 0==(this.flag&e)}},{key:"isOnlyAllow",value:function(e){return this.flag==e}}]),e}();o(c,"SELECT",1),o(c,"INSERT",2),o(c,"UPDATE",4),o(c,"REMOVE",8);var l={name:"Lab",data:function(){return{insert:!1,update:!1,remove:!1,query:!1,permission:new c}},created:function(){var e=this;this.$watch("insert",(function(r){r?e.permission.enable(c.INSERT):e.permission.disable(c.INSERT),console.log("INSERT>>>",e.permission.isAllow(c.INSERT))})),this.$watch("update",(function(r){r?e.permission.enable(c.UPDATE):e.permission.disable(c.UPDATE),console.log("UPDATE>>>",e.permission.isAllow(c.UPDATE))})),this.$watch("remove",(function(r){r?e.permission.enable(c.REMOVE):e.permission.disable(c.REMOVE),console.log("REMOVE>>>",e.permission.isAllow(c.REMOVE))})),this.$watch("query",(function(r){r?e.permission.enable(c.SELECT):e.permission.disable(c.SELECT),console.log("SELECT>>>",e.permission.isAllow(c.SELECT))}))}},u=l,v=i("0c7c"),d=Object(v["a"])(u,n,t,!1,null,null,null);r["default"]=d.exports},bee2:function(e,r,i){"use strict";function n(e,r){for(var i=0;i\n
\n
\n
\n\n\n\n","import mod from \"-!../../node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./CatDomNode.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./CatDomNode.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./CatDomNode.vue?vue&type=template&id=28c33447&\"\nimport script from \"./CatDomNode.vue?vue&type=script&lang=js&\"\nexport * from \"./CatDomNode.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""} -------------------------------------------------------------------------------- /module1/code/dist/js/clipboard.868726fd.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["clipboard"],{1148:function(t,e,r){"use strict";var n=r("a691"),o=r("1d80");t.exports=function(t){var e=String(o(this)),r="",i=n(t);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(e+=e))1&i&&(r+=e);return r}},"159b":function(t,e,r){var n=r("da84"),o=r("fdbc"),i=r("17c2"),a=r("9112");for(var c in o){var u=n[c],s=u&&u.prototype;if(s&&s.forEach!==i)try{a(s,"forEach",i)}catch(f){s.forEach=i}}},"17c2":function(t,e,r){"use strict";var n=r("b727").forEach,o=r("a640"),i=o("forEach");t.exports=i?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},2532:function(t,e,r){"use strict";var n=r("23e7"),o=r("5a34"),i=r("1d80"),a=r("ab13");n({target:"String",proto:!0,forced:!a("includes")},{includes:function(t){return!!~String(i(this)).indexOf(o(t),arguments.length>1?arguments[1]:void 0)}})},"25f0":function(t,e,r){"use strict";var n=r("6eeb"),o=r("825a"),i=r("d039"),a=r("ad6d"),c="toString",u=RegExp.prototype,s=u[c],f=i((function(){return"/a/b"!=s.call({source:"a",flags:"b"})})),l=s.name!=c;(f||l)&&n(RegExp.prototype,c,(function(){var t=o(this),e=String(t.source),r=t.flags,n=String(void 0===r&&t instanceof RegExp&&!("flags"in u)?a.call(t):r);return"/"+e+"/"+n}),{unsafe:!0})},3654:function(t,e,r){},"408a":function(t,e,r){var n=r("c6b6");t.exports=function(t){if("number"!=typeof t&&"Number"!=n(t))throw TypeError("Incorrect invocation");return+t}},"44e7":function(t,e,r){var n=r("861d"),o=r("c6b6"),i=r("b622"),a=i("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[a])?!!e:"RegExp"==o(t))}},"5a34":function(t,e,r){var n=r("44e7");t.exports=function(t){if(n(t))throw TypeError("The method doesn't accept regular expressions");return t}},"65f0":function(t,e,r){var n=r("861d"),o=r("e8b5"),i=r("b622"),a=i("species");t.exports=function(t,e){var r;return o(t)&&(r=t.constructor,"function"!=typeof r||r!==Array&&!o(r.prototype)?n(r)&&(r=r[a],null===r&&(r=void 0)):r=void 0),new(void 0===r?Array:r)(0===e?0:e)}},a640:function(t,e,r){"use strict";var n=r("d039");t.exports=function(t,e){var r=[][t];return!!r&&n((function(){r.call(null,e||function(){throw 1},1)}))}},ab13:function(t,e,r){var n=r("b622"),o=n("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[o]=!1,"/./"[t](e)}catch(n){}}return!1}},ad6d:function(t,e,r){"use strict";var n=r("825a");t.exports=function(){var t=n(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},b116:function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"page"},[t._v(" Clipboard "),r("hr"),r("section",[t._v("复制内容:"+t._s(t.pasteContent)),r("br")]),t._m(0),r("section",[t._v(" 粘贴图片: "),r("img",{ref:"img",attrs:{src:t.pasteImage}})])])},o=[function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("section",[t._v(" 粘贴内容: "),r("textarea")])}],i=(r("b680"),r("d3b7"),r("25f0"),r("159b"),r("caad"),r("2532"),{name:"Keyborad",data:function(){return{copyContent:"",pasteContent:"",pasteImage:""}},mounted:function(){var t=this;this.toFixed(1.005,2),document.body.oncopy=function(t){var e=document.getSelection();t.clipboardData.setData("text/plain","该文档不允许复制剪贴操作,谢谢配合!"+e.toString()),t.preventDefault()},document.body.onpaste=function(e){t.pasteContent=e.clipboardData.getData("text/plain"),e.clipboardData.items&&e.clipboardData.items.forEach((function(e){if(e.type.includes("image")){var r=e.getAsFile();console.log(r);var n=new FileReader;n.onload=function(e){t.$refs.img.style.width=r.width+"px",t.$refs.img.style.height=r.height+"px",t.pasteImage=e.target.result,console.log(t.pasteImage)},n.onerror=function(t){console.log(t)},n.readAsDataURL(r)}}))}},methods:{toFixed:function(t,e){var r=Math.pow(10,e),n=t*r+.5;return n=parseInt(n,10)/r,n+""}}}),a=i,c=(r("d256"),r("0c7c")),u=Object(c["a"])(a,n,o,!1,null,"d2ddcf1c",null);e["default"]=u.exports},b680:function(t,e,r){"use strict";var n=r("23e7"),o=r("a691"),i=r("408a"),a=r("1148"),c=r("d039"),u=1..toFixed,s=Math.floor,f=function(t,e,r){return 0===e?r:e%2===1?f(t,e-1,r*t):f(t*t,e/2,r)},l=function(t){var e=0,r=t;while(r>=4096)e+=12,r/=4096;while(r>=2)e+=1,r/=2;return e},d=function(t,e,r){var n=-1,o=r;while(++n<6)o+=e*t[n],t[n]=o%1e7,o=s(o/1e7)},p=function(t,e){var r=6,n=0;while(--r>=0)n+=t[r],t[r]=s(n/e),n=n%e*1e7},h=function(t){var e=6,r="";while(--e>=0)if(""!==r||0===e||0!==t[e]){var n=String(t[e]);r=""===r?n:r+a.call("0",7-n.length)+n}return r},v=u&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!c((function(){u.call({})}));n({target:"Number",proto:!0,forced:v},{toFixed:function(t){var e,r,n,c,u=i(this),s=o(t),v=[0,0,0,0,0,0],g="",b="0";if(s<0||s>20)throw RangeError("Incorrect fraction digits");if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return String(u);if(u<0&&(g="-",u=-u),u>1e-21)if(e=l(u*f(2,69,1))-69,r=e<0?u*f(2,-e,1):u/f(2,e,1),r*=4503599627370496,e=52-e,e>0){d(v,0,r),n=s;while(n>=7)d(v,1e7,0),n-=7;d(v,f(10,n,1),0),n=e-1;while(n>=23)p(v,1<<23),n-=23;p(v,1<0?(c=b.length,b=g+(c<=s?"0."+a.call("0",s-c)+b:b.slice(0,c-s)+"."+b.slice(c-s))):b=g+b,b}})},b727:function(t,e,r){var n=r("0366"),o=r("44ad"),i=r("7b0b"),a=r("50c4"),c=r("65f0"),u=[].push,s=function(t){var e=1==t,r=2==t,s=3==t,f=4==t,l=6==t,d=7==t,p=5==t||l;return function(h,v,g,b){for(var x,m,y=i(h),w=o(y),E=n(v,g,3),F=a(w.length),S=0,_=b||c,A=e?_(h,F):r||d?_(h,0):void 0;F>S;S++)if((p||S in w)&&(x=w[S],m=E(x,S,y),t))if(e)A[S]=m;else if(m)switch(t){case 3:return!0;case 5:return x;case 6:return S;case 2:u.call(A,x)}else switch(t){case 4:return!1;case 7:u.call(A,x)}return l?-1:s||f?f:A}};t.exports={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterOut:s(7)}},caad:function(t,e,r){"use strict";var n=r("23e7"),o=r("4d64").includes,i=r("44d2");n({target:"Array",proto:!0},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i("includes")},d256:function(t,e,r){"use strict";r("3654")},e8b5:function(t,e,r){var n=r("c6b6");t.exports=Array.isArray||function(t){return"Array"==n(t)}}}]); 2 | //# sourceMappingURL=clipboard.868726fd.js.map -------------------------------------------------------------------------------- /module1/code/dist/js/geolocation.0f86e016.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["geolocation"],{a92f:function(t,o,i){"use strict";i.r(o);var n=function(){var t=this,o=t.$createElement,i=t._self._c||o;return i("div",{staticClass:"geolocation"},[t._v(" Geolocation "),i("hr"),t._v(" 定位坐标: "),i("br"),t._v(" ip: "+t._s(t.ip)),i("br"),t._v(" 纬度:"+t._s(t.position.lat)),i("br"),i("hr"),t._v(" "+t._s(t.msg)+" ")])},e=[],s={name:"geolocation",data:function(){return{position:{},msg:""}},mounted:function(){var t=this;this.timer=setTimeout(this.doTimeout,5e3),navigator.geolocation.getCurrentPosition((function(o){t.position=o,t.timer&&clearTimeout(t.timer)}))},methods:{doTimeout:function(){this.msg="定位超时",this.getIp()},getIp:function(){}}},a=s,r=i("0c7c"),c=Object(r["a"])(a,n,e,!1,null,null,null);o["default"]=c.exports}}]); 2 | //# sourceMappingURL=geolocation.0f86e016.js.map -------------------------------------------------------------------------------- /module1/code/dist/js/geolocation.0f86e016.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///./src/views/Geolocation.vue?a00f","webpack:///src/views/Geolocation.vue","webpack:///./src/views/Geolocation.vue?0d46","webpack:///./src/views/Geolocation.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","_v","_s","ip","position","lat","msg","staticRenderFns","name","data","mounted","timer","setTimeout","doTimeout","navigator","geolocation","getCurrentPosition","clearTimeout","methods","getIp","component"],"mappings":"oHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,eAAe,CAACN,EAAIO,GAAG,iBAAiBH,EAAG,MAAMJ,EAAIO,GAAG,WAAWH,EAAG,MAAMJ,EAAIO,GAAG,QAAQP,EAAIQ,GAAGR,EAAIS,KAAKL,EAAG,MAAMJ,EAAIO,GAAG,OAAOP,EAAIQ,GAAGR,EAAIU,SAASC,MAAMP,EAAG,MAAMA,EAAG,MAAMJ,EAAIO,GAAG,IAAIP,EAAIQ,GAAGR,EAAIY,KAAK,QAC3TC,EAAkB,GCYtB,GACEC,KAAM,cACNC,KAFF,WAGI,MAAO,CACLL,SAAU,GACVE,IAAK,KAGTI,QARF,WAQA,WACIf,KAAKgB,MAAQC,WAAWjB,KAAKkB,UAAW,KACxCC,UAAUC,YAAYC,oBAAmB,SAA7C,GACM,EAAN,WACU,EAAV,OACQC,aAAa,EAArB,WAIEC,QAAS,CACPL,UADJ,WAEMlB,KAAKW,IAAM,OACXX,KAAKwB,SAEPA,MALJ,eC9B0f,I,YCOtfC,EAAY,eACd,EACA3B,EACAc,GACA,EACA,KACA,KACA,MAIa,aAAAa,E","file":"js/geolocation.0f86e016.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"geolocation\"},[_vm._v(\" Geolocation \"),_c('hr'),_vm._v(\" 定位坐标: \"),_c('br'),_vm._v(\" ip: \"+_vm._s(_vm.ip)),_c('br'),_vm._v(\" 纬度:\"+_vm._s(_vm.position.lat)),_c('br'),_c('hr'),_vm._v(\" \"+_vm._s(_vm.msg)+\" \")])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n","import mod from \"-!../../node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./Geolocation.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./Geolocation.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Geolocation.vue?vue&type=template&id=02246577&\"\nimport script from \"./Geolocation.vue?vue&type=script&lang=js&\"\nexport * from \"./Geolocation.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""} -------------------------------------------------------------------------------- /module1/code/dist/js/imageGrid.57cba897.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["imageGrid"],{"95be":function(t,n,e){"use strict";e("ec98")},ec98:function(t,n,e){},ecc8:function(t,n,e){"use strict";e.r(n);var i=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("div",{staticClass:"grid-box"},[t._l(t.imgs,(function(n,i){return[i===t.current?e("div",{key:n,class:t.bigItem,on:{click:function(n){return t.toBig(i)}}},[e("img",{attrs:{src:n}})]):e("div",{key:n,on:{click:function(n){return t.toBig(i)}}},[e("img",{attrs:{src:n}})])]}))],2)},c=[],r={name:"ImageGrid",data:function(){for(var t=[],n=0;n<100;n++)t.push("https://picsum.photos/200/200?t=".concat(Math.random()));return{imgs:t,current:-1,bigItem:"big-item"}},mounted:function(){},methods:{toBig:function(t){this.current=t}}},o=r,s=(e("95be"),e("0c7c")),u=Object(s["a"])(o,i,c,!1,null,"83ee4e46",null);n["default"]=u.exports}}]); 2 | //# sourceMappingURL=imageGrid.57cba897.js.map -------------------------------------------------------------------------------- /module1/code/dist/js/imageGrid.57cba897.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///./src/views/ImageGrid.vue?92b4","webpack:///./src/views/ImageGrid.vue?08e9","webpack:///src/views/ImageGrid.vue","webpack:///./src/views/ImageGrid.vue?6af5","webpack:///./src/views/ImageGrid.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","_l","item","index","current","key","class","bigItem","on","$event","toBig","attrs","staticRenderFns","name","data","temp","push","imgs","mounted","methods","component"],"mappings":"6GAAA,W,gECAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,YAAY,CAACN,EAAIO,GAAIP,EAAQ,MAAE,SAASQ,EAAKC,GAAO,MAAO,CAAEA,IAAUT,EAAIU,QAASN,EAAG,MAAM,CAACO,IAAIH,EAAKI,MAAMZ,EAAIa,QAAQC,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOf,EAAIgB,MAAMP,MAAU,CAACL,EAAG,MAAM,CAACa,MAAM,CAAC,IAAMT,OAAUJ,EAAG,MAAM,CAACO,IAAIH,EAAKM,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOf,EAAIgB,MAAMP,MAAU,CAACL,EAAG,MAAM,CAACa,MAAM,CAAC,IAAMT,YAAc,IACtbU,EAAkB,GCoBtB,GACEC,KAAM,YACNC,KAFF,WAII,IADA,IAAJ,KACA,cACMC,EAAKC,KAAK,mCAAhB,uBAEI,MAAO,CACLC,KAAMF,EACNX,SAAU,EACVG,QAAS,aAGbW,QAbF,aAcEC,QAAS,CACPT,MADJ,SACA,GACMf,KAAKS,QAAUD,KCrCme,I,wBCQpfiB,EAAY,eACd,EACA3B,EACAmB,GACA,EACA,KACA,WACA,MAIa,aAAAQ,E","file":"js/imageGrid.57cba897.js","sourcesContent":["export * from \"-!../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--10-oneOf-1-0!../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../node_modules/less-loader/dist/cjs.js??ref--10-oneOf-1-3!../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./ImageGrid.vue?vue&type=style&index=0&id=83ee4e46&lang=less&scoped=true&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"grid-box\"},[_vm._l((_vm.imgs),function(item,index){return [(index === _vm.current)?_c('div',{key:item,class:_vm.bigItem,on:{\"click\":function($event){return _vm.toBig(index)}}},[_c('img',{attrs:{\"src\":item}})]):_c('div',{key:item,on:{\"click\":function($event){return _vm.toBig(index)}}},[_c('img',{attrs:{\"src\":item}})])]})],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n","import mod from \"-!../../node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./ImageGrid.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./ImageGrid.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./ImageGrid.vue?vue&type=template&id=83ee4e46&scoped=true&\"\nimport script from \"./ImageGrid.vue?vue&type=script&lang=js&\"\nexport * from \"./ImageGrid.vue?vue&type=script&lang=js&\"\nimport style0 from \"./ImageGrid.vue?vue&type=style&index=0&id=83ee4e46&lang=less&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"83ee4e46\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""} -------------------------------------------------------------------------------- /module1/code/dist/js/keyboard.d3e2a7f8.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["keyboard"],{a15b:function(n,t,o){"use strict";var e=o("23e7"),c=o("44ad"),r=o("fc6a"),u=o("a640"),a=[].join,i=c!=Object,l=u("join",",");e({target:"Array",proto:!0,forced:i||!l},{join:function(n){return a.call(r(this),void 0===n?",":n)}})},a640:function(n,t,o){"use strict";var e=o("d039");n.exports=function(n,t){var o=[][n];return!!o&&e((function(){o.call(null,t||function(){throw 1},1)}))}},cbc4:function(n,t,o){"use strict";o.r(t);var e=function(){var n=this,t=n.$createElement,o=n._self._c||t;return o("div",[n._v(" 当前按钮:"+n._s(n.currentKey)+" "),o("div",[o("button",{on:{click:n.doFullScreen}},[n._v("全屏")]),o("button",{on:{click:n.doLock}},[n._v("lock()")]),o("button",{on:{click:n.unLock}},[n._v("unlock()")])])])},c=[],r=(o("a15b"),{name:"Keyborad",data:function(){return{currentKey:""}},mounted:function(){var n=this;document.addEventListener("keydown",(function(t){var o=[];return t.altKey&&o.push("alt"),t.ctrlKey&&o.push("ctrl"),t.metaKey&&o.push("meta"),o.push(t.key),n.currentKey=o.join(" + "),!1}))},methods:{doLock:function(){navigator.keyboard&&navigator.keyboard.lock().then((function(){console.log("locked>>>")}))},unLock:function(){navigator.keyboard.unlock()},doFullScreen:function(){document.documentElement.requestFullscreen()}}}),u=r,a=o("0c7c"),i=Object(a["a"])(u,e,c,!1,null,null,null);t["default"]=i.exports}}]); 2 | //# sourceMappingURL=keyboard.d3e2a7f8.js.map -------------------------------------------------------------------------------- /module1/code/dist/js/lab.bb415a4b.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lab"],{"10d9":function(t,e,a){"use strict";a("8b0b")},"6cd1":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)},o=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div")])}],s={name:"Lab",data:function(){return{}},mounted:function(){console.log(this.getCords(2e3,2e3)),console.log(this.getCords(1e3,1e3))},methods:{getCords:function(t,e){var a=3904,n=2338,o=3703,s=2207,r=a/n,c=o/s,i=(t-2e3)*r+2e3,l=(e-2e3)*c+2e3;return{x:i,y:l}}}},r=s,c=a("0c7c"),i=Object(c["a"])(r,n,o,!1,null,null,null);e["default"]=i.exports},"8b0b":function(t,e,a){},a15b:function(t,e,a){"use strict";var n=a("23e7"),o=a("44ad"),s=a("fc6a"),r=a("a640"),c=[].join,i=o!=Object,l=r("join",",");n({target:"Array",proto:!0,forced:i||!l},{join:function(t){return c.call(s(this),void 0===t?",":t)}})},bc70:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"blog"}},[a("div",{staticClass:"head"},[a("a",{staticClass:"theme",style:"background: #"+t.selected+";",on:{click:function(e){t.show=!0}}},[t._v("主题")])]),a("div",{staticClass:"left"},[t._v("left")]),a("div",{staticClass:"body"},[t._v("body")]),a("div",{staticClass:"footer"},[t._v("© 2021 all rights reserved")]),t.show?a("div",{staticClass:"colorDialog"},t._l(t.colors,(function(e){return a("div",{key:e,staticClass:"color",style:"background: #"+e+";",on:{click:function(a){return t.doSelect(e)}}})})),0):t._e()])},o=[],s={name:"LessTheme",data:function(){return{selected:"#c1cbd7",show:!1,colors:["c1cbd7","afb0b2","939391","bfbfbf","e0e5df","b5c4b1","8696a7","9ca8b8","ececea","fffaf4","96a48b","7b8b6f","dfd7d7","656565","d8caaf","c5b8a5","fdf9ee","f0ebe5","d3d4cc","e0cdcf","b7b1a5","a29988","dadad8","f8ebda"]}},methods:{doSelect:function(t){this.show=!1,this.selected="#".concat(t),window.less.modifyVars({"@themeColor":this.selected}).then((function(){console.log("修改成功")}))}}},r=s,c=(a("10d9"),a("0c7c")),i=Object(c["a"])(r,n,o,!1,null,null,null);e["default"]=i.exports},eef1:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"page"},[t._v(" 浮点数转二进制: "),a("hr"),a("div",{staticClass:"card"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.floatVal,expression:"floatVal"}],staticClass:"text",attrs:{type:"number",placeholder:"输入浮点数"},domProps:{value:t.floatVal},on:{input:function(e){e.target.composing||(t.floatVal=e.target.value)}}})]),a("div",{staticClass:"card"},[t._v("toString(2): "+t._s(t.toStringVal))]),a("div",{staticClass:"card"},[t._v("计算二进制:"+t._s(t.result))])])},o=[],s=a("3835"),r=(a("d3b7"),a("25f0"),a("ac1f"),a("1276"),a("a15b"),{name:"floatToBinary",data:function(){return{floatVal:0}},computed:{toStringVal:function(){return this.floatVal?parseFloat(this.floatVal).toString(2):""},result:function(){if(this.floatVal){var t=this.floatVal.split("."),e=Object(s["a"])(t,2),a=e[0],n=e[1],o=this.intToBinary(a);return n?[o,".",this.fractionToBinary(parseFloat("0."+n))].join(""):o}return""}},mounted:function(){this.fractionToBinary(.2)},methods:{intToBinary:function(t){var e=[];while(t)e.push(t%2),t=parseInt(t/2);return e.reverse().join("")},fractionToBinary:function(t){if(!t)return"0";var e=[],a=0;while(t&&a<13){var n=2*t,o=Math.floor(n);e.push(o),t=n-o,a++}return e.join("")}}}),c=r,i=a("0c7c"),l=Object(i["a"])(c,n,o,!1,null,null,null);e["default"]=l.exports}}]); 2 | //# sourceMappingURL=lab.bb415a4b.js.map -------------------------------------------------------------------------------- /module1/code/dist/js/lasyImage.34d97363.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lasyImage"],{a0c1:function(t,e,s){"use strict";s.r(e);var o=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"out-scroll"},[s("div",{staticClass:"middle-scroll"},[s("div",{staticClass:"place-holder"}),s("img",{ref:"img",staticClass:"lasy-image",attrs:{src:t.src}})])])},n=[],c={data:function(){return{imgSrc:"https://picsum.photos/200/200?t=".concat(Math.random()),src:""}},mounted:function(){var t=this,e=document.createDocumentFragment(),s=document.createElement("div");s.innerHTML="哈哈哈哈哈哈哈哈哈",e.appendChild(s),console.log("fragment>>>",s.offsetHeight),window.addEventListener("scroll",(function(){t.shouldLoad()})),console.log(this.$refs.img.parentNode),this.$refs.img.parentNode.addEventListener("scroll",(function(){t.shouldLoad()}));var o=new IntersectionObserver((function(e){e[0].intersectionRatio<=0&&(t.src="")}));o.observe(document.querySelector(".lasy-image"))},methods:{shouldLoad:function(){var t=this.$refs.img,e=t.parentNode;e.scrollHeight-e.scrollTop<=e.offsetHeight&&(console.log("//进入视野"),this.src=this.imgSrc)}}},i=c,r=(s("d16d"),s("0c7c")),a=Object(r["a"])(i,o,n,!1,null,"5a306725",null);e["default"]=a.exports},a9c9:function(t,e,s){},d16d:function(t,e,s){"use strict";s("a9c9")}}]); 2 | //# sourceMappingURL=lasyImage.34d97363.js.map -------------------------------------------------------------------------------- /module1/code/dist/js/lasyImage.34d97363.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///./src/views/LasyImage.vue?d2d9","webpack:///src/views/LasyImage.vue","webpack:///./src/views/LasyImage.vue?5d6f","webpack:///./src/views/LasyImage.vue","webpack:///./src/views/LasyImage.vue?6b2f"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","ref","attrs","src","staticRenderFns","data","imgSrc","mounted","div","innerHTML","fragment","appendChild","console","log","offsetHeight","window","addEventListener","$refs","img","parentNode","intersectionObserver","IntersectionObserver","entries","intersectionRatio","observe","document","querySelector","methods","shouldLoad","parent","scrollHeight","scrollTop","component"],"mappings":"kHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,cAAc,CAACF,EAAG,MAAM,CAACE,YAAY,iBAAiB,CAACF,EAAG,MAAM,CAACE,YAAY,iBAAiBF,EAAG,MAAM,CAACG,IAAI,MAAMD,YAAY,aAAaE,MAAM,CAAC,IAAMR,EAAIS,YAC9QC,EAAkB,GCStB,GACEC,KADF,WAEI,MAAO,CACLC,OAAQ,mCAAd,sBACMH,IAAK,KAITI,QARF,WAQA,WACA,oCACA,gCACIC,EAAIC,UAAY,YAEhBC,EAASC,YAAYH,GACrBI,QAAQC,IAAI,cAAeL,EAAIM,cAE/BC,OAAOC,iBAAiB,UAAU,WAChC,EAAN,gBAGIJ,QAAQC,IAAIlB,KAAKsB,MAAMC,IAAIC,YAC3BxB,KAAKsB,MAAMC,IAAIC,WAAWH,iBAAiB,UAAU,WACnD,EAAN,gBAGI,IAAII,EAAuB,IAAIC,sBAAqB,SAAxD,GAGUC,EAAQ,GAAGC,mBAAqB,IAClC,EAAR,WASIH,EAAqBI,QAAQC,SAASC,cAAc,iBAGtDC,QAAS,CACPC,WADJ,WAEM,IAAN,iBACA,eACUC,EAAOC,aAAeD,EAAOE,WAAaF,EAAOf,eACnDF,QAAQC,IAAI,UACZlB,KAAKQ,IAAMR,KAAKW,WCzDge,I,wBCQpf0B,EAAY,eACd,EACAvC,EACAW,GACA,EACA,KACA,WACA,MAIa,aAAA4B,E,kECnBf","file":"js/lasyImage.34d97363.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"out-scroll\"},[_c('div',{staticClass:\"middle-scroll\"},[_c('div',{staticClass:\"place-holder\"}),_c('img',{ref:\"img\",staticClass:\"lasy-image\",attrs:{\"src\":_vm.src}})])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n","import mod from \"-!../../node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./LasyImage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./LasyImage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./LasyImage.vue?vue&type=template&id=5a306725&scoped=true&\"\nimport script from \"./LasyImage.vue?vue&type=script&lang=js&\"\nexport * from \"./LasyImage.vue?vue&type=script&lang=js&\"\nimport style0 from \"./LasyImage.vue?vue&type=style&index=0&id=5a306725&lang=less&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"5a306725\",\n null\n \n)\n\nexport default component.exports","export * from \"-!../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--10-oneOf-1-0!../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../node_modules/less-loader/dist/cjs.js??ref--10-oneOf-1-3!../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./LasyImage.vue?vue&type=style&index=0&id=5a306725&lang=less&scoped=true&\""],"sourceRoot":""} -------------------------------------------------------------------------------- /module1/code/dist/js/webWorker.c7f22eea.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["webWorker"],{"0cb2":function(e,t,n){var r=n("7b0b"),a=Math.floor,c="".replace,i=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,o=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,l,u,s){var f=n+e.length,d=l.length,v=o;return void 0!==u&&(u=r(u),v=i),c.call(s,v,(function(r,c){var i;switch(c.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(f);case"<":i=u[c.slice(1,-1)];break;default:var o=+c;if(0===o)return r;if(o>d){var s=a(o/10);return 0===s?r:s<=d?void 0===l[s-1]?c.charAt(1):l[s-1]+c.charAt(1):r}i=l[o-1]}return void 0===i?"":i}))}},"107c":function(e,t,n){var r=n("d039");e.exports=r((function(){var e=RegExp("(?b)","string".charAt(5));return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")}))},"14c3":function(e,t,n){var r=n("c6b6"),a=n("9263");e.exports=function(e,t){var n=e.exec;if("function"===typeof n){var c=n.call(e,t);if("object"!==typeof c)throw TypeError("RegExp exec method returned something other than an Object or null");return c}if("RegExp"!==r(e))throw TypeError("RegExp#exec called on incompatible receiver");return a.call(e,t)}},"27bd":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticStyle:{"font-size":"80px",color:"blue"}},[e._v(e._s(e.time))]),n("a",{staticClass:"btn",on:{click:e.start}},[e._v("开始计时")])])},a=[],c=(n("ac1f"),n("5319"),n("3acd")),i=n.n(c),o={name:"worker",data:function(){return{time:0}},mounted:function(){var e=this;this.worker=new i.a,console.log(String("1234567890").replace(/(\d)(?=(\d{3})+$)/g,(function(e,t,n){return console.log(t,n),t+","}))),this.worker.onmessage=function(t){console.log(t.data.time),e.time=t.data.time}},methods:{start:function(){this.worker.postMessage({start:!0})}}},l=o,u=n("0c7c"),s=Object(u["a"])(l,r,a,!1,null,null,null);t["default"]=s.exports},"3acd":function(e,t){var n=0;self.onmessage=function(e){console.log("worker接受到的message e--",e.data),e.data.start&&setInterval((function(){n++,self.postMessage({time:n})}),1e3)}},5319:function(e,t,n){"use strict";var r=n("d784"),a=n("d039"),c=n("825a"),i=n("50c4"),o=n("a691"),l=n("1d80"),u=n("8aa5"),s=n("0cb2"),f=n("14c3"),d=n("b622"),v=d("replace"),g=Math.max,p=Math.min,x=function(e){return void 0===e?e:String(e)},h=function(){return"$0"==="a".replace(/./,"$0")}(),b=function(){return!!/./[v]&&""===/./[v]("a","$0")}(),m=!a((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}));r("replace",(function(e,t,n){var r=b?"$":"$0";return[function(e,n){var r=l(this),a=void 0==e?void 0:e[v];return void 0!==a?a.call(e,r,n):t.call(String(r),e,n)},function(e,a){if("string"===typeof a&&-1===a.indexOf(r)&&-1===a.indexOf("$<")){var l=n(t,this,e,a);if(l.done)return l.value}var d=c(this),v=String(e),h="function"===typeof a;h||(a=String(a));var b=d.global;if(b){var m=d.unicode;d.lastIndex=0}var w=[];while(1){var E=f(d,v);if(null===E)break;if(w.push(E),!b)break;var I=String(E[0]);""===I&&(d.lastIndex=u(v,i(d.lastIndex),m))}for(var y="",R=0,$=0;$=R&&(y+=v.slice(R,S)+M,R=S+k.length)}return y+v.slice(R)}]}),!m||!h||b)},"8aa5":function(e,t,n){"use strict";var r=n("6547").charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},9263:function(e,t,n){"use strict";var r=n("ad6d"),a=n("9f7f"),c=n("5692"),i=n("7c73"),o=n("69f3").get,l=n("fce3"),u=n("107c"),s=RegExp.prototype.exec,f=c("native-string-replace",String.prototype.replace),d=s,v=function(){var e=/a/,t=/b*/g;return s.call(e,"a"),s.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),g=a.UNSUPPORTED_Y||a.BROKEN_CARET,p=void 0!==/()??/.exec("")[1],x=v||p||g||l||u;x&&(d=function(e){var t,n,a,c,l,u,x,h=this,b=o(h),m=b.raw;if(m)return m.lastIndex=h.lastIndex,t=d.call(m,e),h.lastIndex=m.lastIndex,t;var w=b.groups,E=g&&h.sticky,I=r.call(h),y=h.source,R=0,$=e;if(E&&(I=I.replace("y",""),-1===I.indexOf("g")&&(I+="g"),$=String(e).slice(h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==e[h.lastIndex-1])&&(y="(?: "+y+")",$=" "+$,R++),n=new RegExp("^(?:"+y+")",I)),p&&(n=new RegExp("^"+y+"$(?!\\s)",I)),v&&(a=h.lastIndex),c=s.call(E?n:h,$),E?c?(c.input=c.input.slice(R),c[0]=c[0].slice(R),c.index=h.lastIndex,h.lastIndex+=c[0].length):h.lastIndex=0:v&&c&&(h.lastIndex=h.global?c.index+c[0].length:a),p&&c&&c.length>1&&f.call(c[0],n,(function(){for(l=1;l0&&t.oldVersiont?await this.m.deleteEntry(i.id):s.push(f(i))}return s}async g({request:t,metadata:e,timestamp:s=Date.now()},i){const n={requestData:(await o.fromRequest(t.clone())).toObject(),timestamp:s};e&&(n.metadata=e),await this.m[`${i}Entry`](n),this.k?this.D=!0:await this.registerSync()}async R(t){const e=Date.now(),s=await this.m[`${t}Entry`]();if(s){const i=60*this.q*1e3;return e-s.timestamp>i?this.R(t):f(s)}}async replayRequests(){let t;for(;t=await this.shiftRequest();)try{await fetch(t.request.clone())}catch(s){throw await this.unshiftRequest(t),new e.WorkboxError("queue-replay-failed",{name:this.u})}}async registerSync(){if("sync"in registration)try{await registration.sync.register(`${u}:${this.u}`)}catch(t){}}p(){"sync"in registration?self.addEventListener("sync",t=>{if(t.tag===`${u}:${this.u}`){const e=async()=>{let e;this.k=!0;try{await this.l({queue:this})}catch(t){throw e=t}finally{!this.D||e&&!t.lastChance||await this.registerSync(),this.k=!1,this.D=!1}};t.waitUntil(e())}}):this.l({queue:this})}static get _(){return w}}const f=t=>{const e={request:new o(t.requestData).toRequest(),timestamp:t.timestamp};return t.metadata&&(e.metadata=t.metadata),e};return t.Queue=d,t.Plugin=class{constructor(...t){this.v=new d(...t),this.fetchDidFail=this.fetchDidFail.bind(this)}async fetchDidFail({request:t}){await this.v.pushRequest({request:t})}},t}({},workbox.core._private,workbox.core._private); 2 | //# sourceMappingURL=workbox-background-sync.prod.js.map 3 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-broadcast-update.prod.js: -------------------------------------------------------------------------------- 1 | this.workbox=this.workbox||{},this.workbox.broadcastUpdate=function(e,t){"use strict";try{self["workbox:broadcast-update:4.3.1"]&&_()}catch(e){}const s=(e,t,s)=>{return!s.some(s=>e.headers.has(s)&&t.headers.has(s))||s.every(s=>{const n=e.headers.has(s)===t.headers.has(s),a=e.headers.get(s)===t.headers.get(s);return n&&a})},n="workbox",a=1e4,i=["content-length","etag","last-modified"],o=async({channel:e,cacheName:t,url:s})=>{const n={type:"CACHE_UPDATED",meta:"workbox-broadcast-update",payload:{cacheName:t,updatedURL:s}};if(e)e.postMessage(n);else{const e=await clients.matchAll({type:"window"});for(const t of e)t.postMessage(n)}};class c{constructor({headersToCheck:e,channelName:t,deferNoticationTimeout:s}={}){this.t=e||i,this.s=t||n,this.i=s||a,this.o()}notifyIfUpdated({oldResponse:e,newResponse:t,url:n,cacheName:a,event:i}){if(!s(e,t,this.t)){const e=(async()=>{i&&i.request&&"navigate"===i.request.mode&&await this.h(i),await this.l({channel:this.u(),cacheName:a,url:n})})();if(i)try{i.waitUntil(e)}catch(e){}return e}}async l(e){await o(e)}u(){return"BroadcastChannel"in self&&!this.p&&(this.p=new BroadcastChannel(this.s)),this.p}h(e){if(!this.m.has(e)){const s=new t.Deferred;this.m.set(e,s);const n=setTimeout(()=>{s.resolve()},this.i);s.promise.then(()=>clearTimeout(n))}return this.m.get(e).promise}o(){this.m=new Map,self.addEventListener("message",e=>{if("WINDOW_READY"===e.data.type&&"workbox-window"===e.data.meta&&this.m.size>0){for(const e of this.m.values())e.resolve();this.m.clear()}})}}return e.BroadcastCacheUpdate=c,e.Plugin=class{constructor(e){this.l=new c(e)}cacheDidUpdate({cacheName:e,oldResponse:t,newResponse:s,request:n,event:a}){t&&this.l.notifyIfUpdated({cacheName:e,oldResponse:t,newResponse:s,event:a,url:n.url})}},e.broadcastUpdate=o,e.responsesAreSame=s,e}({},workbox.core._private); 2 | //# sourceMappingURL=workbox-broadcast-update.prod.js.map 3 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-cacheable-response.prod.js: -------------------------------------------------------------------------------- 1 | this.workbox=this.workbox||{},this.workbox.cacheableResponse=function(t){"use strict";try{self["workbox:cacheable-response:4.3.1"]&&_()}catch(t){}class s{constructor(t={}){this.t=t.statuses,this.s=t.headers}isResponseCacheable(t){let s=!0;return this.t&&(s=this.t.includes(t.status)),this.s&&s&&(s=Object.keys(this.s).some(s=>t.headers.get(s)===this.s[s])),s}}return t.CacheableResponse=s,t.Plugin=class{constructor(t){this.i=new s(t)}cacheWillUpdate({response:t}){return this.i.isResponseCacheable(t)?t:null}},t}({}); 2 | //# sourceMappingURL=workbox-cacheable-response.prod.js.map 3 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-core.prod.js: -------------------------------------------------------------------------------- 1 | this.workbox=this.workbox||{},this.workbox.core=function(e){"use strict";try{self["workbox:core:4.3.1"]&&_()}catch(e){}const t=(e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n};class n extends Error{constructor(e,n){super(t(e,n)),this.name=e,this.details=n}}const s=new Set;const r={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:self.registration.scope},a=e=>[r.prefix,e,r.suffix].filter(e=>e.length>0).join("-"),i={updateDetails:e=>{Object.keys(r).forEach(t=>{void 0!==e[t]&&(r[t]=e[t])})},getGoogleAnalyticsName:e=>e||a(r.googleAnalytics),getPrecacheName:e=>e||a(r.precache),getPrefix:()=>r.prefix,getRuntimeName:e=>e||a(r.runtime),getSuffix:()=>r.suffix},c=e=>{const t=new URL(e,location);return t.origin===location.origin?t.pathname:t.href};async function o(){for(const e of s)await e()}const l="cacheDidUpdate",u="cacheKeyWillBeUsed",h="cacheWillUpdate",f="cachedResponseWillBeUsed",w="fetchDidFail",g="fetchDidSucceed",d="requestWillFetch",p=(e,t)=>e.filter(e=>t in e),y=async({cacheName:e,request:t,event:n,matchOptions:s,plugins:r=[]})=>{const a=await caches.open(e),i=await q({plugins:r,request:t,mode:"read"});let c=await a.match(i,s);for(const t of r)f in t&&(c=await t[f].call(t,{cacheName:e,event:n,matchOptions:s,cachedResponse:c,request:i}));return c},m=async({request:e,response:t,event:n,plugins:s})=>{let r=t,a=!1;for(let t of s)if(h in t&&(a=!0,!(r=await t[h].call(t,{request:e,response:r,event:n}))))break;return a||(r=200===r.status?r:null),r||null},q=async({request:e,mode:t,plugins:n})=>{const s=p(n,u);let r=e;for(const e of s)"string"==typeof(r=await e[u].call(e,{mode:t,request:r}))&&(r=new Request(r));return r},v={put:async({cacheName:e,request:t,response:s,event:r,plugins:a=[],matchOptions:i}={})=>{const u=await q({plugins:a,request:t,mode:"write"});if(!s)throw new n("cache-put-with-no-response",{url:c(u.url)});let h=await m({event:r,plugins:a,response:s,request:u});if(!h)return;const f=await caches.open(e),w=p(a,l);let g=w.length>0?await y({cacheName:e,matchOptions:i,request:u}):null;try{await f.put(u,h)}catch(e){throw"QuotaExceededError"===e.name&&await o(),e}for(let t of w)await t[l].call(t,{cacheName:e,event:r,oldResponse:g,newResponse:h,request:u})},match:y};class x{constructor(e,t,{onupgradeneeded:n,onversionchange:s=this.t}={}){this.s=e,this.i=t,this.o=n,this.t=s,this.l=null}get db(){return this.l}async open(){if(!this.l)return this.l=await new Promise((e,t)=>{let n=!1;setTimeout(()=>{n=!0,t(new Error("The open request was blocked and timed out"))},this.OPEN_TIMEOUT);const s=indexedDB.open(this.s,this.i);s.onerror=(()=>t(s.error)),s.onupgradeneeded=(e=>{n?(s.transaction.abort(),e.target.result.close()):this.o&&this.o(e)}),s.onsuccess=(({target:t})=>{const s=t.result;n?s.close():(s.onversionchange=this.t.bind(this),e(s))})}),this}async getKey(e,t){return(await this.getAllKeys(e,t,1))[0]}async getAll(e,t,n){return await this.getAllMatching(e,{query:t,count:n})}async getAllKeys(e,t,n){return(await this.getAllMatching(e,{query:t,count:n,includeKeys:!0})).map(({key:e})=>e)}async getAllMatching(e,{index:t,query:n=null,direction:s="next",count:r,includeKeys:a}={}){return await this.transaction([e],"readonly",(i,c)=>{const o=i.objectStore(e),l=t?o.index(t):o,u=[];l.openCursor(n,s).onsuccess=(({target:e})=>{const t=e.result;if(t){const{primaryKey:e,key:n,value:s}=t;u.push(a?{primaryKey:e,key:n,value:s}:s),r&&u.length>=r?c(u):t.continue()}else c(u)})})}async transaction(e,t,n){return await this.open(),await new Promise((s,r)=>{const a=this.l.transaction(e,t);a.onabort=(({target:e})=>r(e.error)),a.oncomplete=(()=>s()),n(a,e=>s(e))})}async u(e,t,n,...s){return await this.transaction([t],n,(n,r)=>{n.objectStore(t)[e](...s).onsuccess=(({target:e})=>{r(e.result)})})}t(){this.close()}close(){this.l&&(this.l.close(),this.l=null)}}x.prototype.OPEN_TIMEOUT=2e3;const b={readonly:["get","count","getKey","getAll","getAllKeys"],readwrite:["add","put","clear","delete"]};for(const[e,t]of Object.entries(b))for(const n of t)n in IDBObjectStore.prototype&&(x.prototype[n]=async function(t,...s){return await this.u(n,t,e,...s)});const D={fetch:async({request:e,fetchOptions:t,event:s,plugins:r=[]})=>{if(s&&s.preloadResponse){const e=await s.preloadResponse;if(e)return e}"string"==typeof e&&(e=new Request(e));const a=p(r,w),i=a.length>0?e.clone():null;try{for(let t of r)d in t&&(e=await t[d].call(t,{request:e.clone(),event:s}))}catch(e){throw new n("plugin-error-request-will-fetch",{thrownError:e})}let c=e.clone();try{let n;n="navigate"===e.mode?await fetch(e):await fetch(e,t);for(const e of r)g in e&&(n=await e[g].call(e,{event:s,request:c,response:n}));return n}catch(e){for(const t of a)await t[w].call(t,{error:e,event:s,originalRequest:i.clone(),request:c.clone()});throw e}}};var E=Object.freeze({assert:null,cacheNames:i,cacheWrapper:v,DBWrapper:x,Deferred:class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}},deleteDatabase:async e=>{await new Promise((t,n)=>{const s=indexedDB.deleteDatabase(e);s.onerror=(({target:e})=>{n(e.error)}),s.onblocked=(()=>{n(new Error("Delete blocked"))}),s.onsuccess=(()=>{t()})})},executeQuotaErrorCallbacks:o,fetchWrapper:D,getFriendlyURL:c,logger:null,WorkboxError:n});const N={get googleAnalytics(){return i.getGoogleAnalyticsName()},get precache(){return i.getPrecacheName()},get prefix(){return i.getPrefix()},get runtime(){return i.getRuntimeName()},get suffix(){return i.getSuffix()}};try{self.workbox.v=self.workbox.v||{}}catch(e){}return e._private=E,e.clientsClaim=(()=>{addEventListener("activate",()=>clients.claim())}),e.cacheNames=N,e.registerQuotaErrorCallback=function(e){s.add(e)},e.setCacheNameDetails=(e=>{i.updateDetails(e)}),e.skipWaiting=(()=>{addEventListener("install",()=>self.skipWaiting())}),e}({}); 2 | //# sourceMappingURL=workbox-core.prod.js.map 3 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-expiration.prod.js: -------------------------------------------------------------------------------- 1 | this.workbox=this.workbox||{},this.workbox.expiration=function(t,e,s,i,a,n){"use strict";try{self["workbox:expiration:4.3.1"]&&_()}catch(t){}const h="workbox-expiration",c="cache-entries",r=t=>{const e=new URL(t,location);return e.hash="",e.href};class o{constructor(t){this.t=t,this.s=new e.DBWrapper(h,1,{onupgradeneeded:t=>this.i(t)})}i(t){const e=t.target.result.createObjectStore(c,{keyPath:"id"});e.createIndex("cacheName","cacheName",{unique:!1}),e.createIndex("timestamp","timestamp",{unique:!1}),s.deleteDatabase(this.t)}async setTimestamp(t,e){t=r(t),await this.s.put(c,{url:t,timestamp:e,cacheName:this.t,id:this.h(t)})}async getTimestamp(t){return(await this.s.get(c,this.h(t))).timestamp}async expireEntries(t,e){const s=await this.s.transaction(c,"readwrite",(s,i)=>{const a=s.objectStore(c),n=[];let h=0;a.index("timestamp").openCursor(null,"prev").onsuccess=(({target:s})=>{const a=s.result;if(a){const s=a.value;s.cacheName===this.t&&(t&&s.timestamp=e?n.push(a.value):h++),a.continue()}else i(n)})}),i=[];for(const t of s)await this.s.delete(c,t.id),i.push(t.url);return i}h(t){return this.t+"|"+r(t)}}class u{constructor(t,e={}){this.o=!1,this.u=!1,this.l=e.maxEntries,this.p=e.maxAgeSeconds,this.t=t,this.m=new o(t)}async expireEntries(){if(this.o)return void(this.u=!0);this.o=!0;const t=this.p?Date.now()-1e3*this.p:void 0,e=await this.m.expireEntries(t,this.l),s=await caches.open(this.t);for(const t of e)await s.delete(t);this.o=!1,this.u&&(this.u=!1,this.expireEntries())}async updateTimestamp(t){await this.m.setTimestamp(t,Date.now())}async isURLExpired(t){return await this.m.getTimestamp(t)this.deleteCacheAndMetadata())}k(t){if(t===a.cacheNames.getRuntimeName())throw new i.WorkboxError("expire-custom-caches-only");let e=this.g.get(t);return e||(e=new u(t,this.D),this.g.set(t,e)),e}cachedResponseWillBeUsed({event:t,request:e,cacheName:s,cachedResponse:i}){if(!i)return null;let a=this.N(i);const n=this.k(s);n.expireEntries();const h=n.updateTimestamp(e.url);if(t)try{t.waitUntil(h)}catch(t){}return a?i:null}N(t){if(!this.p)return!0;const e=this._(t);return null===e||e>=Date.now()-1e3*this.p}_(t){if(!t.headers.has("date"))return null;const e=t.headers.get("date"),s=new Date(e).getTime();return isNaN(s)?null:s}async cacheDidUpdate({cacheName:t,request:e}){const s=this.k(t);await s.updateTimestamp(e.url),await s.expireEntries()}async deleteCacheAndMetadata(){for(const[t,e]of this.g)await caches.delete(t),await e.delete();this.g=new Map}},t}({},workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private,workbox.core); 2 | //# sourceMappingURL=workbox-expiration.prod.js.map 3 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-navigation-preload.dev.js: -------------------------------------------------------------------------------- 1 | this.workbox = this.workbox || {}; 2 | this.workbox.navigationPreload = (function (exports, logger_mjs) { 3 | 'use strict'; 4 | 5 | try { 6 | self['workbox:navigation-preload:4.3.1'] && _(); 7 | } catch (e) {} // eslint-disable-line 8 | 9 | /* 10 | Copyright 2018 Google LLC 11 | 12 | Use of this source code is governed by an MIT-style 13 | license that can be found in the LICENSE file or at 14 | https://opensource.org/licenses/MIT. 15 | */ 16 | /** 17 | * @return {boolean} Whether or not the current browser supports enabling 18 | * navigation preload. 19 | * 20 | * @memberof workbox.navigationPreload 21 | */ 22 | 23 | function isSupported() { 24 | return Boolean(self.registration && self.registration.navigationPreload); 25 | } 26 | 27 | /* 28 | Copyright 2018 Google LLC 29 | 30 | Use of this source code is governed by an MIT-style 31 | license that can be found in the LICENSE file or at 32 | https://opensource.org/licenses/MIT. 33 | */ 34 | /** 35 | * If the browser supports Navigation Preload, then this will disable it. 36 | * 37 | * @memberof workbox.navigationPreload 38 | */ 39 | 40 | function disable() { 41 | if (isSupported()) { 42 | self.addEventListener('activate', event => { 43 | event.waitUntil(self.registration.navigationPreload.disable().then(() => { 44 | { 45 | logger_mjs.logger.log(`Navigation preload is disabled.`); 46 | } 47 | })); 48 | }); 49 | } else { 50 | { 51 | logger_mjs.logger.log(`Navigation preload is not supported in this browser.`); 52 | } 53 | } 54 | } 55 | 56 | /* 57 | Copyright 2018 Google LLC 58 | 59 | Use of this source code is governed by an MIT-style 60 | license that can be found in the LICENSE file or at 61 | https://opensource.org/licenses/MIT. 62 | */ 63 | /** 64 | * If the browser supports Navigation Preload, then this will enable it. 65 | * 66 | * @param {string} [headerValue] Optionally, allows developers to 67 | * [override](https://developers.google.com/web/updates/2017/02/navigation-preload#changing_the_header) 68 | * the value of the `Service-Worker-Navigation-Preload` header which will be 69 | * sent to the server when making the navigation request. 70 | * 71 | * @memberof workbox.navigationPreload 72 | */ 73 | 74 | function enable(headerValue) { 75 | if (isSupported()) { 76 | self.addEventListener('activate', event => { 77 | event.waitUntil(self.registration.navigationPreload.enable().then(() => { 78 | // Defaults to Service-Worker-Navigation-Preload: true if not set. 79 | if (headerValue) { 80 | self.registration.navigationPreload.setHeaderValue(headerValue); 81 | } 82 | 83 | { 84 | logger_mjs.logger.log(`Navigation preload is enabled.`); 85 | } 86 | })); 87 | }); 88 | } else { 89 | { 90 | logger_mjs.logger.log(`Navigation preload is not supported in this browser.`); 91 | } 92 | } 93 | } 94 | 95 | /* 96 | Copyright 2018 Google LLC 97 | 98 | Use of this source code is governed by an MIT-style 99 | license that can be found in the LICENSE file or at 100 | https://opensource.org/licenses/MIT. 101 | */ 102 | 103 | exports.disable = disable; 104 | exports.enable = enable; 105 | exports.isSupported = isSupported; 106 | 107 | return exports; 108 | 109 | }({}, workbox.core._private)); 110 | //# sourceMappingURL=workbox-navigation-preload.dev.js.map 111 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-navigation-preload.dev.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"workbox-navigation-preload.dev.js","sources":["../_version.mjs","../isSupported.mjs","../disable.mjs","../enable.mjs","../index.mjs"],"sourcesContent":["try{self['workbox:navigation-preload:4.3.1']&&_()}catch(e){}// eslint-disable-line","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\n\nimport './_version.mjs';\n\n/**\n * @return {boolean} Whether or not the current browser supports enabling\n * navigation preload.\n *\n * @memberof workbox.navigationPreload\n */\nfunction isSupported() {\n return Boolean(self.registration && self.registration.navigationPreload);\n}\n\nexport {isSupported};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\n\nimport {logger} from 'workbox-core/_private/logger.mjs';\n\nimport {isSupported} from './isSupported.mjs';\n\nimport './_version.mjs';\n\n/**\n * If the browser supports Navigation Preload, then this will disable it.\n *\n * @memberof workbox.navigationPreload\n */\nfunction disable() {\n if (isSupported()) {\n self.addEventListener('activate', (event) => {\n event.waitUntil(\n self.registration.navigationPreload.disable().then(() => {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Navigation preload is disabled.`);\n }\n })\n );\n });\n } else {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Navigation preload is not supported in this browser.`);\n }\n }\n}\n\nexport {disable};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\n\nimport {logger} from 'workbox-core/_private/logger.mjs';\n\nimport {isSupported} from './isSupported.mjs';\n\nimport './_version.mjs';\n\n/**\n * If the browser supports Navigation Preload, then this will enable it.\n *\n * @param {string} [headerValue] Optionally, allows developers to\n * [override](https://developers.google.com/web/updates/2017/02/navigation-preload#changing_the_header)\n * the value of the `Service-Worker-Navigation-Preload` header which will be\n * sent to the server when making the navigation request.\n *\n * @memberof workbox.navigationPreload\n */\nfunction enable(headerValue) {\n if (isSupported()) {\n self.addEventListener('activate', (event) => {\n event.waitUntil(\n self.registration.navigationPreload.enable().then(() => {\n // Defaults to Service-Worker-Navigation-Preload: true if not set.\n if (headerValue) {\n self.registration.navigationPreload.setHeaderValue(headerValue);\n }\n\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Navigation preload is enabled.`);\n }\n })\n );\n });\n } else {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Navigation preload is not supported in this browser.`);\n }\n }\n}\n\nexport {enable};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\n\nimport {disable} from './disable.mjs';\nimport {enable} from './enable.mjs';\nimport {isSupported} from './isSupported.mjs';\nimport './_version.mjs';\n\n\n/**\n * @namespace workbox.navigationPreload\n */\n\nexport {\n disable,\n enable,\n isSupported,\n};\n"],"names":["self","_","e","isSupported","Boolean","registration","navigationPreload","disable","addEventListener","event","waitUntil","then","logger","log","enable","headerValue","setHeaderValue"],"mappings":";;;;EAAA,IAAG;EAACA,EAAAA,IAAI,CAAC,kCAAD,CAAJ,IAA0CC,CAAC,EAA3C;EAA8C,CAAlD,CAAkD,OAAMC,CAAN,EAAQ;;ECA1D;;;;;;;AAQA,EAEA;;;;;;;EAMA,SAASC,WAAT,GAAuB;EACrB,SAAOC,OAAO,CAACJ,IAAI,CAACK,YAAL,IAAqBL,IAAI,CAACK,YAAL,CAAkBC,iBAAxC,CAAd;EACD;;EClBD;;;;;;;AAQA,EAMA;;;;;;EAKA,SAASC,OAAT,GAAmB;EACjB,MAAIJ,WAAW,EAAf,EAAmB;EACjBH,IAAAA,IAAI,CAACQ,gBAAL,CAAsB,UAAtB,EAAmCC,KAAD,IAAW;EAC3CA,MAAAA,KAAK,CAACC,SAAN,CACIV,IAAI,CAACK,YAAL,CAAkBC,iBAAlB,CAAoCC,OAApC,GAA8CI,IAA9C,CAAmD,MAAM;EACvD,QAA2C;EACzCC,UAAAA,iBAAM,CAACC,GAAP,CAAY,iCAAZ;EACD;EACF,OAJD,CADJ;EAOD,KARD;EASD,GAVD,MAUO;EACL,IAA2C;EACzCD,MAAAA,iBAAM,CAACC,GAAP,CAAY,sDAAZ;EACD;EACF;EACF;;ECnCD;;;;;;;AAQA,EAMA;;;;;;;;;;;EAUA,SAASC,MAAT,CAAgBC,WAAhB,EAA6B;EAC3B,MAAIZ,WAAW,EAAf,EAAmB;EACjBH,IAAAA,IAAI,CAACQ,gBAAL,CAAsB,UAAtB,EAAmCC,KAAD,IAAW;EAC3CA,MAAAA,KAAK,CAACC,SAAN,CACIV,IAAI,CAACK,YAAL,CAAkBC,iBAAlB,CAAoCQ,MAApC,GAA6CH,IAA7C,CAAkD,MAAM;EACxD;EACE,YAAII,WAAJ,EAAiB;EACff,UAAAA,IAAI,CAACK,YAAL,CAAkBC,iBAAlB,CAAoCU,cAApC,CAAmDD,WAAnD;EACD;;EAED,QAA2C;EACzCH,UAAAA,iBAAM,CAACC,GAAP,CAAY,gCAAZ;EACD;EACF,OATD,CADJ;EAYD,KAbD;EAcD,GAfD,MAeO;EACL,IAA2C;EACzCD,MAAAA,iBAAM,CAACC,GAAP,CAAY,sDAAZ;EACD;EACF;EACF;;EC7CD;;;;;;;;;;;;;;;;;;"} -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-navigation-preload.prod.js: -------------------------------------------------------------------------------- 1 | this.workbox=this.workbox||{},this.workbox.navigationPreload=function(t){"use strict";try{self["workbox:navigation-preload:4.3.1"]&&_()}catch(t){}function e(){return Boolean(self.registration&&self.registration.navigationPreload)}return t.disable=function(){e()&&self.addEventListener("activate",t=>{t.waitUntil(self.registration.navigationPreload.disable().then(()=>{}))})},t.enable=function(t){e()&&self.addEventListener("activate",e=>{e.waitUntil(self.registration.navigationPreload.enable().then(()=>{t&&self.registration.navigationPreload.setHeaderValue(t)}))})},t.isSupported=e,t}({}); 2 | //# sourceMappingURL=workbox-navigation-preload.prod.js.map 3 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-navigation-preload.prod.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"workbox-navigation-preload.prod.js","sources":["../_version.mjs","../isSupported.mjs","../disable.mjs","../enable.mjs"],"sourcesContent":["try{self['workbox:navigation-preload:4.3.1']&&_()}catch(e){}// eslint-disable-line","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\n\nimport './_version.mjs';\n\n/**\n * @return {boolean} Whether or not the current browser supports enabling\n * navigation preload.\n *\n * @memberof workbox.navigationPreload\n */\nfunction isSupported() {\n return Boolean(self.registration && self.registration.navigationPreload);\n}\n\nexport {isSupported};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\n\nimport {logger} from 'workbox-core/_private/logger.mjs';\n\nimport {isSupported} from './isSupported.mjs';\n\nimport './_version.mjs';\n\n/**\n * If the browser supports Navigation Preload, then this will disable it.\n *\n * @memberof workbox.navigationPreload\n */\nfunction disable() {\n if (isSupported()) {\n self.addEventListener('activate', (event) => {\n event.waitUntil(\n self.registration.navigationPreload.disable().then(() => {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Navigation preload is disabled.`);\n }\n })\n );\n });\n } else {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Navigation preload is not supported in this browser.`);\n }\n }\n}\n\nexport {disable};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\n\nimport {logger} from 'workbox-core/_private/logger.mjs';\n\nimport {isSupported} from './isSupported.mjs';\n\nimport './_version.mjs';\n\n/**\n * If the browser supports Navigation Preload, then this will enable it.\n *\n * @param {string} [headerValue] Optionally, allows developers to\n * [override](https://developers.google.com/web/updates/2017/02/navigation-preload#changing_the_header)\n * the value of the `Service-Worker-Navigation-Preload` header which will be\n * sent to the server when making the navigation request.\n *\n * @memberof workbox.navigationPreload\n */\nfunction enable(headerValue) {\n if (isSupported()) {\n self.addEventListener('activate', (event) => {\n event.waitUntil(\n self.registration.navigationPreload.enable().then(() => {\n // Defaults to Service-Worker-Navigation-Preload: true if not set.\n if (headerValue) {\n self.registration.navigationPreload.setHeaderValue(headerValue);\n }\n\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Navigation preload is enabled.`);\n }\n })\n );\n });\n } else {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Navigation preload is not supported in this browser.`);\n }\n }\n}\n\nexport {enable};\n"],"names":["self","_","e","isSupported","Boolean","registration","navigationPreload","addEventListener","event","waitUntil","disable","then","headerValue","enable","setHeaderValue"],"mappings":"sFAAA,IAAIA,KAAK,qCAAqCC,IAAI,MAAMC,ICgBxD,SAASC,WACAC,QAAQJ,KAAKK,cAAgBL,KAAKK,aAAaC,oCCExD,WACMH,KACFH,KAAKO,iBAAiB,WAAaC,IACjCA,EAAMC,UACFT,KAAKK,aAAaC,kBAAkBI,UAAUC,KAAK,qBCC7D,SAAgBC,GACVT,KACFH,KAAKO,iBAAiB,WAAaC,IACjCA,EAAMC,UACFT,KAAKK,aAAaC,kBAAkBO,SAASF,KAAK,KAE5CC,GACFZ,KAAKK,aAAaC,kBAAkBQ,eAAeF"} -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-offline-ga.prod.js: -------------------------------------------------------------------------------- 1 | this.workbox=this.workbox||{},this.workbox.googleAnalytics=function(e,t,o,n,a,c,w){"use strict";try{self["workbox:google-analytics:4.3.1"]&&_()}catch(e){}const r=/^\/(\w+\/)?collect/,s=e=>async({queue:t})=>{let o;for(;o=await t.shiftRequest();){const{request:n,timestamp:a}=o,c=new URL(n.url);try{const w="POST"===n.method?new URLSearchParams(await n.clone().text()):c.searchParams,r=a-(Number(w.get("qt"))||0),s=Date.now()-r;if(w.set("qt",s),e.parameterOverrides)for(const t of Object.keys(e.parameterOverrides)){const o=e.parameterOverrides[t];w.set(t,o)}"function"==typeof e.hitFilter&&e.hitFilter.call(null,w),await fetch(new Request(c.origin+c.pathname,{body:w.toString(),method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"text/plain"}}))}catch(e){throw await t.unshiftRequest(o),e}}},i=e=>{const t=({url:e})=>"www.google-analytics.com"===e.hostname&&r.test(e.pathname),o=new w.NetworkOnly({plugins:[e]});return[new n.Route(t,o,"GET"),new n.Route(t,o,"POST")]},l=e=>{const t=new c.NetworkFirst({cacheName:e});return new n.Route(({url:e})=>"www.google-analytics.com"===e.hostname&&"/analytics.js"===e.pathname,t,"GET")},m=e=>{const t=new c.NetworkFirst({cacheName:e});return new n.Route(({url:e})=>"www.googletagmanager.com"===e.hostname&&"/gtag/js"===e.pathname,t,"GET")},u=e=>{const t=new c.NetworkFirst({cacheName:e});return new n.Route(({url:e})=>"www.googletagmanager.com"===e.hostname&&"/gtm.js"===e.pathname,t,"GET")};return e.initialize=((e={})=>{const n=o.cacheNames.getGoogleAnalyticsName(e.cacheName),c=new t.Plugin("workbox-google-analytics",{maxRetentionTime:2880,onSync:s(e)}),w=[u(n),l(n),m(n),...i(c)],r=new a.Router;for(const e of w)r.registerRoute(e);r.addFetchListener()}),e}({},workbox.backgroundSync,workbox.core._private,workbox.routing,workbox.routing,workbox.strategies,workbox.strategies); 2 | //# sourceMappingURL=workbox-offline-ga.prod.js.map 3 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-precaching.prod.js: -------------------------------------------------------------------------------- 1 | this.workbox=this.workbox||{},this.workbox.precaching=function(t,e,n,s,c){"use strict";try{self["workbox:precaching:4.3.1"]&&_()}catch(t){}const o=[],i={get:()=>o,add(t){o.push(...t)}};const a="__WB_REVISION__";function r(t){if(!t)throw new c.WorkboxError("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new c.WorkboxError("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location);return{cacheKey:t.href,url:t.href}}const s=new URL(n,location),o=new URL(n,location);return o.searchParams.set(a,e),{cacheKey:o.href,url:s.href}}class l{constructor(t){this.t=e.cacheNames.getPrecacheName(t),this.s=new Map}addToCacheList(t){for(const e of t){const{cacheKey:t,url:n}=r(e);if(this.s.has(n)&&this.s.get(n)!==t)throw new c.WorkboxError("add-to-cache-list-conflicting-entries",{firstEntry:this.s.get(n),secondEntry:t});this.s.set(n,t)}}async install({event:t,plugins:e}={}){const n=[],s=[],c=await caches.open(this.t),o=await c.keys(),i=new Set(o.map(t=>t.url));for(const t of this.s.values())i.has(t)?s.push(t):n.push(t);const a=n.map(n=>this.o({event:t,plugins:e,url:n}));return await Promise.all(a),{updatedURLs:n,notUpdatedURLs:s}}async activate(){const t=await caches.open(this.t),e=await t.keys(),n=new Set(this.s.values()),s=[];for(const c of e)n.has(c.url)||(await t.delete(c),s.push(c.url));return{deletedURLs:s}}async o({url:t,event:e,plugins:o}){const i=new Request(t,{credentials:"same-origin"});let a,r=await s.fetchWrapper.fetch({event:e,plugins:o,request:i});for(const t of o||[])"cacheWillUpdate"in t&&(a=t.cacheWillUpdate.bind(t));if(!(a?a({event:e,request:i,response:r}):r.status<400))throw new c.WorkboxError("bad-precaching-response",{url:t,status:r.status});r.redirected&&(r=await async function(t){const e=t.clone(),n="body"in e?Promise.resolve(e.body):e.blob(),s=await n;return new Response(s,{headers:e.headers,status:e.status,statusText:e.statusText})}(r)),await n.cacheWrapper.put({event:e,plugins:o,request:i,response:r,cacheName:this.t,matchOptions:{ignoreSearch:!0}})}getURLsToCacheKeys(){return this.s}getCachedURLs(){return[...this.s.keys()]}getCacheKeyForURL(t){const e=new URL(t,location);return this.s.get(e.href)}}let u;const h=()=>(u||(u=new l),u);const d=(t,e)=>{const n=h().getURLsToCacheKeys();for(const s of function*(t,{ignoreURLParametersMatching:e,directoryIndex:n,cleanURLs:s,urlManipulation:c}={}){const o=new URL(t,location);o.hash="",yield o.href;const i=function(t,e){for(const n of[...t.searchParams.keys()])e.some(t=>t.test(n))&&t.searchParams.delete(n);return t}(o,e);if(yield i.href,n&&i.pathname.endsWith("/")){const t=new URL(i);t.pathname+=n,yield t.href}if(s){const t=new URL(i);t.pathname+=".html",yield t.href}if(c){const t=c({url:o});for(const e of t)yield e.href}}(t,e)){const t=n.get(s);if(t)return t}};let w=!1;const f=t=>{w||((({ignoreURLParametersMatching:t=[/^utm_/],directoryIndex:n="index.html",cleanURLs:s=!0,urlManipulation:c=null}={})=>{const o=e.cacheNames.getPrecacheName();addEventListener("fetch",e=>{const i=d(e.request.url,{cleanURLs:s,directoryIndex:n,ignoreURLParametersMatching:t,urlManipulation:c});if(!i)return;let a=caches.open(o).then(t=>t.match(i)).then(t=>t||fetch(i));e.respondWith(a)})})(t),w=!0)},y=t=>{const e=h(),n=i.get();t.waitUntil(e.install({event:t,plugins:n}).catch(t=>{throw t}))},p=t=>{const e=h(),n=i.get();t.waitUntil(e.activate({event:t,plugins:n}))},L=t=>{h().addToCacheList(t),t.length>0&&(addEventListener("install",y),addEventListener("activate",p))};return t.addPlugins=(t=>{i.add(t)}),t.addRoute=f,t.cleanupOutdatedCaches=(()=>{addEventListener("activate",t=>{const n=e.cacheNames.getPrecacheName();t.waitUntil((async(t,e="-precache-")=>{const n=(await caches.keys()).filter(n=>n.includes(e)&&n.includes(self.registration.scope)&&n!==t);return await Promise.all(n.map(t=>caches.delete(t))),n})(n).then(t=>{}))})}),t.getCacheKeyForURL=(t=>{return h().getCacheKeyForURL(t)}),t.precache=L,t.precacheAndRoute=((t,e)=>{L(t),f(e)}),t.PrecacheController=l,t}({},workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private); 2 | //# sourceMappingURL=workbox-precaching.prod.js.map 3 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-range-requests.prod.js: -------------------------------------------------------------------------------- 1 | this.workbox=this.workbox||{},this.workbox.rangeRequests=function(e,n){"use strict";try{self["workbox:range-requests:4.3.1"]&&_()}catch(e){}async function t(e,t){try{if(206===t.status)return t;const s=e.headers.get("range");if(!s)throw new n.WorkboxError("no-range-header");const a=function(e){const t=e.trim().toLowerCase();if(!t.startsWith("bytes="))throw new n.WorkboxError("unit-must-be-bytes",{normalizedRangeHeader:t});if(t.includes(","))throw new n.WorkboxError("single-range-only",{normalizedRangeHeader:t});const s=/(\d*)-(\d*)/.exec(t);if(null===s||!s[1]&&!s[2])throw new n.WorkboxError("invalid-range-values",{normalizedRangeHeader:t});return{start:""===s[1]?null:Number(s[1]),end:""===s[2]?null:Number(s[2])}}(s),r=await t.blob(),i=function(e,t,s){const a=e.size;if(s>a||t<0)throw new n.WorkboxError("range-not-satisfiable",{size:a,end:s,start:t});let r,i;return null===t?(r=a-s,i=a):null===s?(r=t,i=a):(r=t,i=s+1),{start:r,end:i}}(r,a.start,a.end),o=r.slice(i.start,i.end),u=o.size,l=new Response(o,{status:206,statusText:"Partial Content",headers:t.headers});return l.headers.set("Content-Length",u),l.headers.set("Content-Range",`bytes ${i.start}-${i.end-1}/`+r.size),l}catch(e){return new Response("",{status:416,statusText:"Range Not Satisfiable"})}}return e.createPartialResponse=t,e.Plugin=class{async cachedResponseWillBeUsed({request:e,cachedResponse:n}){return n&&e.headers.has("range")?await t(e,n):n}},e}({},workbox.core._private); 2 | //# sourceMappingURL=workbox-range-requests.prod.js.map 3 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-routing.prod.js: -------------------------------------------------------------------------------- 1 | this.workbox=this.workbox||{},this.workbox.routing=function(t,e,r){"use strict";try{self["workbox:routing:4.3.1"]&&_()}catch(t){}const s="GET",n=t=>t&&"object"==typeof t?t:{handle:t};class o{constructor(t,e,r){this.handler=n(e),this.match=t,this.method=r||s}}class i extends o{constructor(t,{whitelist:e=[/./],blacklist:r=[]}={}){super(t=>this.t(t),t),this.s=e,this.o=r}t({url:t,request:e}){if("navigate"!==e.mode)return!1;const r=t.pathname+t.search;for(const t of this.o)if(t.test(r))return!1;return!!this.s.some(t=>t.test(r))}}class u extends o{constructor(t,e,r){super(({url:e})=>{const r=t.exec(e.href);return r?e.origin!==location.origin&&0!==r.index?null:r.slice(1):null},e,r)}}class c{constructor(){this.i=new Map}get routes(){return this.i}addFetchListener(){self.addEventListener("fetch",t=>{const{request:e}=t,r=this.handleRequest({request:e,event:t});r&&t.respondWith(r)})}addCacheListener(){self.addEventListener("message",async t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,r=Promise.all(e.urlsToCache.map(t=>{"string"==typeof t&&(t=[t]);const e=new Request(...t);return this.handleRequest({request:e})}));t.waitUntil(r),t.ports&&t.ports[0]&&(await r,t.ports[0].postMessage(!0))}})}handleRequest({request:t,event:e}){const r=new URL(t.url,location);if(!r.protocol.startsWith("http"))return;let s,{params:n,route:o}=this.findMatchingRoute({url:r,request:t,event:e}),i=o&&o.handler;if(!i&&this.u&&(i=this.u),i){try{s=i.handle({url:r,request:t,event:e,params:n})}catch(t){s=Promise.reject(t)}return s&&this.h&&(s=s.catch(t=>this.h.handle({url:r,event:e,err:t}))),s}}findMatchingRoute({url:t,request:e,event:r}){const s=this.i.get(e.method)||[];for(const n of s){let s,o=n.match({url:t,request:e,event:r});if(o)return Array.isArray(o)&&o.length>0?s=o:o.constructor===Object&&Object.keys(o).length>0&&(s=o),{route:n,params:s}}return{}}setDefaultHandler(t){this.u=n(t)}setCatchHandler(t){this.h=n(t)}registerRoute(t){this.i.has(t.method)||this.i.set(t.method,[]),this.i.get(t.method).push(t)}unregisterRoute(t){if(!this.i.has(t.method))throw new r.WorkboxError("unregister-route-but-not-found-with-method",{method:t.method});const e=this.i.get(t.method).indexOf(t);if(!(e>-1))throw new r.WorkboxError("unregister-route-route-not-registered");this.i.get(t.method).splice(e,1)}}let a;const h=()=>(a||((a=new c).addFetchListener(),a.addCacheListener()),a);return t.NavigationRoute=i,t.RegExpRoute=u,t.registerNavigationRoute=((t,r={})=>{const s=e.cacheNames.getPrecacheName(r.cacheName),n=new i(async()=>{try{const e=await caches.match(t,{cacheName:s});if(e)return e;throw new Error(`The cache ${s} did not have an entry for `+`${t}.`)}catch(e){return fetch(t)}},{whitelist:r.whitelist,blacklist:r.blacklist});return h().registerRoute(n),n}),t.registerRoute=((t,e,s="GET")=>{let n;if("string"==typeof t){const r=new URL(t,location);n=new o(({url:t})=>t.href===r.href,e,s)}else if(t instanceof RegExp)n=new u(t,e,s);else if("function"==typeof t)n=new o(t,e,s);else{if(!(t instanceof o))throw new r.WorkboxError("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});n=t}return h().registerRoute(n),n}),t.Route=o,t.Router=c,t.setCatchHandler=(t=>{h().setCatchHandler(t)}),t.setDefaultHandler=(t=>{h().setDefaultHandler(t)}),t}({},workbox.core._private,workbox.core._private); 2 | //# sourceMappingURL=workbox-routing.prod.js.map 3 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-strategies.prod.js: -------------------------------------------------------------------------------- 1 | this.workbox=this.workbox||{},this.workbox.strategies=function(e,t,s,n,r){"use strict";try{self["workbox:strategies:4.3.1"]&&_()}catch(e){}class i{constructor(e={}){this.t=t.cacheNames.getRuntimeName(e.cacheName),this.s=e.plugins||[],this.i=e.fetchOptions||null,this.h=e.matchOptions||null}async handle({event:e,request:t}){return this.makeRequest({event:e,request:t||e.request})}async makeRequest({event:e,request:t}){"string"==typeof t&&(t=new Request(t));let n,i=await s.cacheWrapper.match({cacheName:this.t,request:t,event:e,matchOptions:this.h,plugins:this.s});if(!i)try{i=await this.u(t,e)}catch(e){n=e}if(!i)throw new r.WorkboxError("no-response",{url:t.url,error:n});return i}async u(e,t){const r=await n.fetchWrapper.fetch({request:e,event:t,fetchOptions:this.i,plugins:this.s}),i=r.clone(),h=s.cacheWrapper.put({cacheName:this.t,request:e,response:i,event:t,plugins:this.s});if(t)try{t.waitUntil(h)}catch(e){}return r}}class h{constructor(e={}){this.t=t.cacheNames.getRuntimeName(e.cacheName),this.s=e.plugins||[],this.h=e.matchOptions||null}async handle({event:e,request:t}){return this.makeRequest({event:e,request:t||e.request})}async makeRequest({event:e,request:t}){"string"==typeof t&&(t=new Request(t));const n=await s.cacheWrapper.match({cacheName:this.t,request:t,event:e,matchOptions:this.h,plugins:this.s});if(!n)throw new r.WorkboxError("no-response",{url:t.url});return n}}const u={cacheWillUpdate:({response:e})=>200===e.status||0===e.status?e:null};class a{constructor(e={}){if(this.t=t.cacheNames.getRuntimeName(e.cacheName),e.plugins){let t=e.plugins.some(e=>!!e.cacheWillUpdate);this.s=t?e.plugins:[u,...e.plugins]}else this.s=[u];this.o=e.networkTimeoutSeconds,this.i=e.fetchOptions||null,this.h=e.matchOptions||null}async handle({event:e,request:t}){return this.makeRequest({event:e,request:t||e.request})}async makeRequest({event:e,request:t}){const s=[];"string"==typeof t&&(t=new Request(t));const n=[];let i;if(this.o){const{id:r,promise:h}=this.l({request:t,event:e,logs:s});i=r,n.push(h)}const h=this.q({timeoutId:i,request:t,event:e,logs:s});n.push(h);let u=await Promise.race(n);if(u||(u=await h),!u)throw new r.WorkboxError("no-response",{url:t.url});return u}l({request:e,logs:t,event:s}){let n;return{promise:new Promise(t=>{n=setTimeout(async()=>{t(await this.p({request:e,event:s}))},1e3*this.o)}),id:n}}async q({timeoutId:e,request:t,logs:r,event:i}){let h,u;try{u=await n.fetchWrapper.fetch({request:t,event:i,fetchOptions:this.i,plugins:this.s})}catch(e){h=e}if(e&&clearTimeout(e),h||!u)u=await this.p({request:t,event:i});else{const e=u.clone(),n=s.cacheWrapper.put({cacheName:this.t,request:t,response:e,event:i,plugins:this.s});if(i)try{i.waitUntil(n)}catch(e){}}return u}p({event:e,request:t}){return s.cacheWrapper.match({cacheName:this.t,request:t,event:e,matchOptions:this.h,plugins:this.s})}}class c{constructor(e={}){this.t=t.cacheNames.getRuntimeName(e.cacheName),this.s=e.plugins||[],this.i=e.fetchOptions||null}async handle({event:e,request:t}){return this.makeRequest({event:e,request:t||e.request})}async makeRequest({event:e,request:t}){let s,i;"string"==typeof t&&(t=new Request(t));try{i=await n.fetchWrapper.fetch({request:t,event:e,fetchOptions:this.i,plugins:this.s})}catch(e){s=e}if(!i)throw new r.WorkboxError("no-response",{url:t.url,error:s});return i}}class o{constructor(e={}){if(this.t=t.cacheNames.getRuntimeName(e.cacheName),this.s=e.plugins||[],e.plugins){let t=e.plugins.some(e=>!!e.cacheWillUpdate);this.s=t?e.plugins:[u,...e.plugins]}else this.s=[u];this.i=e.fetchOptions||null,this.h=e.matchOptions||null}async handle({event:e,request:t}){return this.makeRequest({event:e,request:t||e.request})}async makeRequest({event:e,request:t}){"string"==typeof t&&(t=new Request(t));const n=this.u({request:t,event:e});let i,h=await s.cacheWrapper.match({cacheName:this.t,request:t,event:e,matchOptions:this.h,plugins:this.s});if(h){if(e)try{e.waitUntil(n)}catch(i){}}else try{h=await n}catch(e){i=e}if(!h)throw new r.WorkboxError("no-response",{url:t.url,error:i});return h}async u({request:e,event:t}){const r=await n.fetchWrapper.fetch({request:e,event:t,fetchOptions:this.i,plugins:this.s}),i=s.cacheWrapper.put({cacheName:this.t,request:e,response:r.clone(),event:t,plugins:this.s});if(t)try{t.waitUntil(i)}catch(e){}return r}}const l={cacheFirst:i,cacheOnly:h,networkFirst:a,networkOnly:c,staleWhileRevalidate:o},q=e=>{const t=l[e];return e=>new t(e)},w=q("cacheFirst"),p=q("cacheOnly"),v=q("networkFirst"),y=q("networkOnly"),m=q("staleWhileRevalidate");return e.CacheFirst=i,e.CacheOnly=h,e.NetworkFirst=a,e.NetworkOnly=c,e.StaleWhileRevalidate=o,e.cacheFirst=w,e.cacheOnly=p,e.networkFirst=v,e.networkOnly=y,e.staleWhileRevalidate=m,e}({},workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private); 2 | //# sourceMappingURL=workbox-strategies.prod.js.map 3 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-streams.prod.js: -------------------------------------------------------------------------------- 1 | this.workbox=this.workbox||{},this.workbox.streams=function(e){"use strict";try{self["workbox:streams:4.3.1"]&&_()}catch(e){}function n(e){const n=e.map(e=>Promise.resolve(e).then(e=>(function(e){return e.body&&e.body.getReader?e.body.getReader():e.getReader?e.getReader():new Response(e).body.getReader()})(e)));let t,r;const s=new Promise((e,n)=>{t=e,r=n});let o=0;return{done:s,stream:new ReadableStream({pull(e){return n[o].then(e=>e.read()).then(r=>{if(r.done)return++o>=n.length?(e.close(),void t()):this.pull(e);e.enqueue(r.value)}).catch(e=>{throw r(e),e})},cancel(){t()}})}}function t(e={}){const n=new Headers(e);return n.has("content-type")||n.set("content-type","text/html"),n}function r(e,r){const{done:s,stream:o}=n(e),a=t(r);return{done:s,response:new Response(o,{headers:a})}}let s=void 0;function o(){if(void 0===s)try{new ReadableStream({start(){}}),s=!0}catch(e){s=!1}return s}return e.concatenate=n,e.concatenateToResponse=r,e.isSupported=o,e.strategy=function(e,n){return async({event:s,url:a,params:c})=>{if(o()){const{done:t,response:o}=r(e.map(e=>e({event:s,url:a,params:c})),n);return s.waitUntil(t),o}const i=await Promise.all(e.map(e=>e({event:s,url:a,params:c})).map(async e=>{const n=await e;return n instanceof Response?n.blob():n})),u=t(n);return new Response(new Blob(i),{headers:u})}},e}({}); 2 | //# sourceMappingURL=workbox-streams.prod.js.map 3 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-sw.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";try{self["workbox:sw:4.3.1"]&&_()}catch(t){}const t="https://storage.googleapis.com/workbox-cdn/releases/4.3.1",e={backgroundSync:"background-sync",broadcastUpdate:"broadcast-update",cacheableResponse:"cacheable-response",core:"core",expiration:"expiration",googleAnalytics:"offline-ga",navigationPreload:"navigation-preload",precaching:"precaching",rangeRequests:"range-requests",routing:"routing",strategies:"strategies",streams:"streams"};self.workbox=new class{constructor(){return this.v={},this.t={debug:"localhost"===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.s=this.t.debug?"dev":"prod",this.o=!1,new Proxy(this,{get(t,s){if(t[s])return t[s];const o=e[s];return o&&t.loadModule(`workbox-${o}`),t[s]}})}setConfig(t={}){if(this.o)throw new Error("Config must be set before accessing workbox.* modules");Object.assign(this.t,t),this.s=this.t.debug?"dev":"prod"}loadModule(t){const e=this.i(t);try{importScripts(e),this.o=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}i(e){if(this.t.modulePathCb)return this.t.modulePathCb(e,this.t.debug);let s=[t];const o=`${e}.${this.s}.js`,r=this.t.modulePathPrefix;return r&&""===(s=r.split("/"))[s.length-1]&&s.splice(s.length-1,1),s.push(o),s.join("/")}}}(); 2 | //# sourceMappingURL=workbox-sw.js.map 3 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-window.prod.es5.mjs: -------------------------------------------------------------------------------- 1 | try{self["workbox:window:4.3.1"]&&_()}catch(n){}var n=function(n,t){return new Promise(function(i){var e=new MessageChannel;e.port1.onmessage=function(n){return i(n.data)},n.postMessage(t,[e.port2])})};function t(n,t){for(var i=0;i0||!r(n.scriptURL,this.t)||performance.now()>this.L+6e4?(this.W=n,this.B.removeEventListener("updatefound",this.g)):(this.O=n,this.u.resolve(n)),++this.o,n.addEventListener("statechange",this.l)},d.l=function(n){var t=this,i=n.target,e=i.state,r=i===this.W,u=r?"external":"",a={sw:i,originalEvent:n};!r&&this.p&&(a.isUpdate=!0),this.dispatchEvent(new o(u+e,a)),"installed"===e?this._=setTimeout(function(){"installed"===e&&t.B.waiting===i&&t.dispatchEvent(new o(u+"waiting",a))},200):"activating"===e&&(clearTimeout(this._),r||this.s.resolve(i))},d.m=function(n){var t=this.O;t===navigator.serviceWorker.controller&&(this.dispatchEvent(new o("controlling",{sw:t,originalEvent:n})),this.h.resolve(t))},d.v=function(n){var t=n.data;this.dispatchEvent(new o("message",{data:t,originalEvent:n}))},l=v,(w=[{key:"active",get:function(){return this.s.promise}},{key:"controlling",get:function(){return this.h.promise}}])&&t(l.prototype,w),g&&t(l,g),v}(function(){function n(){this.D={}}var t=n.prototype;return t.addEventListener=function(n,t){this.T(n).add(t)},t.removeEventListener=function(n,t){this.T(n).delete(t)},t.dispatchEvent=function(n){n.target=this,this.T(n.type).forEach(function(t){return t(n)})},t.T=function(n){return this.D[n]=this.D[n]||new Set},n}());export{c as Workbox,n as messageSW}; 2 | //# sourceMappingURL=workbox-window.prod.es5.mjs.map 3 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-window.prod.mjs: -------------------------------------------------------------------------------- 1 | try{self["workbox:window:4.3.1"]&&_()}catch(t){}const t=(t,s)=>new Promise(i=>{let e=new MessageChannel;e.port1.onmessage=(t=>i(t.data)),t.postMessage(s,[e.port2])});try{self["workbox:core:4.3.1"]&&_()}catch(t){}class s{constructor(){this.promise=new Promise((t,s)=>{this.resolve=t,this.reject=s})}}class i{constructor(){this.t={}}addEventListener(t,s){this.s(t).add(s)}removeEventListener(t,s){this.s(t).delete(s)}dispatchEvent(t){t.target=this,this.s(t.type).forEach(s=>s(t))}s(t){return this.t[t]=this.t[t]||new Set}}const e=(t,s)=>new URL(t,location).href===new URL(s,location).href;class n{constructor(t,s){Object.assign(this,s,{type:t})}}const h=200,a=6e4;class o extends i{constructor(t,i={}){super(),this.i=t,this.h=i,this.o=0,this.l=new s,this.g=new s,this.u=new s,this.m=this.m.bind(this),this.v=this.v.bind(this),this.p=this.p.bind(this),this._=this._.bind(this)}async register({immediate:t=!1}={}){t||"complete"===document.readyState||await new Promise(t=>addEventListener("load",t)),this.C=Boolean(navigator.serviceWorker.controller),this.W=this.L(),this.S=await this.B(),this.W&&(this.R=this.W,this.g.resolve(this.W),this.u.resolve(this.W),this.P(this.W),this.W.addEventListener("statechange",this.v,{once:!0}));const s=this.S.waiting;return s&&e(s.scriptURL,this.i)&&(this.R=s,Promise.resolve().then(()=>{this.dispatchEvent(new n("waiting",{sw:s,wasWaitingBeforeRegister:!0}))})),this.R&&this.l.resolve(this.R),this.S.addEventListener("updatefound",this.p),navigator.serviceWorker.addEventListener("controllerchange",this._,{once:!0}),"BroadcastChannel"in self&&(this.T=new BroadcastChannel("workbox"),this.T.addEventListener("message",this.m)),navigator.serviceWorker.addEventListener("message",this.m),this.S}get active(){return this.g.promise}get controlling(){return this.u.promise}async getSW(){return this.R||this.l.promise}async messageSW(s){const i=await this.getSW();return t(i,s)}L(){const t=navigator.serviceWorker.controller;if(t&&e(t.scriptURL,this.i))return t}async B(){try{const t=await navigator.serviceWorker.register(this.i,this.h);return this.U=performance.now(),t}catch(t){throw t}}P(s){t(s,{type:"WINDOW_READY",meta:"workbox-window"})}p(){const t=this.S.installing;this.o>0||!e(t.scriptURL,this.i)||performance.now()>this.U+a?(this.k=t,this.S.removeEventListener("updatefound",this.p)):(this.R=t,this.l.resolve(t)),++this.o,t.addEventListener("statechange",this.v)}v(t){const s=t.target,{state:i}=s,e=s===this.k,a=e?"external":"",o={sw:s,originalEvent:t};!e&&this.C&&(o.isUpdate=!0),this.dispatchEvent(new n(a+i,o)),"installed"===i?this.D=setTimeout(()=>{"installed"===i&&this.S.waiting===s&&this.dispatchEvent(new n(a+"waiting",o))},h):"activating"===i&&(clearTimeout(this.D),e||this.g.resolve(s))}_(t){const s=this.R;s===navigator.serviceWorker.controller&&(this.dispatchEvent(new n("controlling",{sw:s,originalEvent:t})),this.u.resolve(s))}m(t){const{data:s}=t;this.dispatchEvent(new n("message",{data:s,originalEvent:t}))}}export{o as Workbox,t as messageSW}; 2 | //# sourceMappingURL=workbox-window.prod.mjs.map 3 | -------------------------------------------------------------------------------- /module1/code/dist/workbox-v4.3.1/workbox-window.prod.umd.js: -------------------------------------------------------------------------------- 1 | !function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).workbox={})}(this,function(n){"use strict";try{self["workbox:window:4.3.1"]&&_()}catch(n){}var t=function(n,t){return new Promise(function(i){var e=new MessageChannel;e.port1.onmessage=function(n){return i(n.data)},n.postMessage(t,[e.port2])})};function i(n,t){for(var i=0;i0||!o(n.scriptURL,this.t)||performance.now()>this.C+6e4?(this.L=n,this.R.removeEventListener("updatefound",this.g)):(this._=n,this.u.resolve(n)),++this.o,n.addEventListener("statechange",this.l)},g.l=function(n){var t=this,i=n.target,e=i.state,r=i===this.L,o=r?"external":"",s={sw:i,originalEvent:n};!r&&this.p&&(s.isUpdate=!0),this.dispatchEvent(new u(o+e,s)),"installed"===e?this.W=setTimeout(function(){"installed"===e&&t.R.waiting===i&&t.dispatchEvent(new u(o+"waiting",s))},200):"activating"===e&&(clearTimeout(this.W),r||this.s.resolve(i))},g.m=function(n){var t=this._;t===navigator.serviceWorker.controller&&(this.dispatchEvent(new u("controlling",{sw:t,originalEvent:n})),this.h.resolve(t))},g.v=function(n){var t=n.data;this.dispatchEvent(new u("message",{data:t,originalEvent:n}))},l=v,(w=[{key:"active",get:function(){return this.s.promise}},{key:"controlling",get:function(){return this.h.promise}}])&&i(l.prototype,w),d&&i(l,d),v}(function(){function n(){this.D={}}var t=n.prototype;return t.addEventListener=function(n,t){this.M(n).add(t)},t.removeEventListener=function(n,t){this.M(n).delete(t)},t.dispatchEvent=function(n){n.target=this,this.M(n.type).forEach(function(t){return t(n)})},t.M=function(n){return this.D[n]=this.D[n]||new Set},n}());n.Workbox=f,n.messageSW=t,Object.defineProperty(n,"__esModule",{value:!0})}); 2 | //# sourceMappingURL=workbox-window.prod.umd.js.map 3 | -------------------------------------------------------------------------------- /module1/code/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: "@vue/cli-plugin-unit-jest", 3 | }; 4 | -------------------------------------------------------------------------------- /module1/code/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "main", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "test:unit": "vue-cli-service test:unit", 9 | "lint": "vue-cli-service lint" 10 | }, 11 | "dependencies": { 12 | "@vue/cli": "^4.5.13", 13 | "register-service-worker": "^1.7.1", 14 | "vue": "^2.6.11", 15 | "vue-router": "^3.2.0" 16 | }, 17 | "devDependencies": { 18 | "@vue/cli-plugin-babel": "^4.5.0", 19 | "@vue/cli-plugin-eslint": "^4.5.0", 20 | "@vue/cli-plugin-pwa": "^4.5.13", 21 | "@vue/cli-plugin-unit-jest": "^4.5.0", 22 | "@vue/cli-service": "^4.5.0", 23 | "@vue/eslint-config-prettier": "^6.0.0", 24 | "@vue/test-utils": "^1.0.3", 25 | "babel-eslint": "^10.1.0", 26 | "core-js": "^3.6.5", 27 | "eslint": "^6.7.2", 28 | "eslint-plugin-prettier": "^3.3.1", 29 | "eslint-plugin-vue": "^6.2.2", 30 | "express": "^4.17.1", 31 | "less": "^3.0.4", 32 | "less-loader": "^5.0.0", 33 | "prettier": "^2.2.1", 34 | "vue-template-compiler": "^2.6.11", 35 | "webpack": "^5.44.0", 36 | "worker-loader": "^3.0.8" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /module1/code/public/css/siteTheme.less: -------------------------------------------------------------------------------- 1 | @themeColor: #c1cbd7; 2 | 3 | #blog { 4 | min-height: 100%; 5 | display: grid; 6 | grid-template-columns: 200px auto; 7 | grid-template-rows: 100px auto 100px; 8 | 9 | .head { 10 | grid-column: span 2; 11 | background-color: @themeColor; 12 | } 13 | .left { 14 | background-color: fade(@themeColor, 30%); 15 | } 16 | .footer { 17 | grid-column: span 2; 18 | background-color: darken(@themeColor, 50%); 19 | color: lighten(@themeColor, 50%); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /module1/code/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/public/favicon.ico -------------------------------------------------------------------------------- /module1/code/public/img/icons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/public/img/icons/android-chrome-192x192.png -------------------------------------------------------------------------------- /module1/code/public/img/icons/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/public/img/icons/android-chrome-512x512.png -------------------------------------------------------------------------------- /module1/code/public/img/icons/android-chrome-maskable-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/public/img/icons/android-chrome-maskable-192x192.png -------------------------------------------------------------------------------- /module1/code/public/img/icons/android-chrome-maskable-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/public/img/icons/android-chrome-maskable-512x512.png -------------------------------------------------------------------------------- /module1/code/public/img/icons/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/public/img/icons/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /module1/code/public/img/icons/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/public/img/icons/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /module1/code/public/img/icons/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/public/img/icons/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /module1/code/public/img/icons/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/public/img/icons/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /module1/code/public/img/icons/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/public/img/icons/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /module1/code/public/img/icons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/public/img/icons/apple-touch-icon.png -------------------------------------------------------------------------------- /module1/code/public/img/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/public/img/icons/favicon-16x16.png -------------------------------------------------------------------------------- /module1/code/public/img/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/public/img/icons/favicon-32x32.png -------------------------------------------------------------------------------- /module1/code/public/img/icons/msapplication-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/public/img/icons/msapplication-icon-144x144.png -------------------------------------------------------------------------------- /module1/code/public/img/icons/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/public/img/icons/mstile-150x150.png -------------------------------------------------------------------------------- /module1/code/public/img/icons/safari-pinned-tab.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /module1/code/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | <%= htmlWebpackPlugin.options.title %> 12 | 13 | 14 | 26 | 27 | 28 | 29 | 30 | 34 |
35 | 36 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /module1/code/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /module1/code/server.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | var express = require("express"); 3 | var app = express(); 4 | 5 | // Serve up content from public directory 6 | app.use(express.static(path.join(__dirname, "dist"))); 7 | 8 | var server = app.listen(9000, function () { 9 | var host = "localhost"; 10 | var port = server.address().port; 11 | console.log("listening on http://" + host + ":" + port + "/"); 12 | }); 13 | -------------------------------------------------------------------------------- /module1/code/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/src/.DS_Store -------------------------------------------------------------------------------- /module1/code/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 51 | -------------------------------------------------------------------------------- /module1/code/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/src/assets/logo.png -------------------------------------------------------------------------------- /module1/code/src/components/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/src/components/.DS_Store -------------------------------------------------------------------------------- /module1/code/src/components/CatNode/index.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/src/components/CatNode/index.vue -------------------------------------------------------------------------------- /module1/code/src/components/FishTemplate/components/NewsList.js: -------------------------------------------------------------------------------- 1 | export default { 2 | render() { 3 | return ` 4 |
5 |
6 |
7 |
{{item.title}}
8 |
9 |
10 | `; 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /module1/code/src/components/FishTemplate/engine.js: -------------------------------------------------------------------------------- 1 | import Vnode from "./vnode.js"; 2 | 3 | export default class Engine { 4 | constructor() { 5 | this.nodes = new Map(); 6 | } 7 | 8 | render(template, data) { 9 | const re1 = /<(\w+)\s*([^>]*)>([^<]*)<\/\1>/gm; //匹配
XXX
10 | const re2 = /<(\w+)\s*([^(/>)]*)\/>/gm; //匹配 11 | template = template.replace(/\n/gm, ""); 12 | while (re1.test(template) || re2.test(template)) { 13 | //
XXX
类型 14 | template = template.replace(re1, (s0, s1, s2, s3) => { 15 | let attr = this.parseAttribute(s2); 16 | // let children = this.parseAttribute(s3); 17 | let node = new Vnode(s1, attr, [], null, s3); 18 | this.nodes.set(node.uuid, node); 19 | return `(${node.uuid})`; 20 | }); 21 | //类型 22 | template = template.replace(re2, (s0, s1, s2) => { 23 | let attr = this.parseAttribute(s2); 24 | let node = new Vnode(s1, attr, [], null, ""); 25 | this.nodes.set(node.uuid, node); 26 | return `(${node.uuid})`; 27 | }); 28 | } 29 | console.log("第一阶段|解析创建node>>>", this.nodes); 30 | let rootNode = this.parseToNode(template); 31 | console.log("第二阶段|构建nodeTree>>>", rootNode); 32 | let dom = this.parseNodeToDom(rootNode, data); 33 | console.log("第三阶段|nodeTree To DomTree>>>", dom); 34 | return dom; 35 | } 36 | 37 | parseToNode(template) { 38 | let re = /\((.*?)\)/g; 39 | let stack = []; 40 | let parent = new Vnode("root", {}, [], null, template, null); 41 | stack.push(parent); 42 | //转成成node节点 43 | while (stack.length > 0) { 44 | let pnode = stack.pop(); 45 | let nodestr = pnode.childrenTemplate.trim(); 46 | re.lastIndex = 0; 47 | [...nodestr.matchAll(re)].forEach((item) => { 48 | let n = this.nodes.get(item[1]); 49 | let newn = new Vnode( 50 | n.tag, 51 | n.attr, 52 | [], 53 | pnode, 54 | n.childrenTemplate, 55 | null 56 | ); 57 | pnode.children.push(newn); 58 | stack.push(newn); 59 | }); 60 | } 61 | return parent.children[0]; 62 | } 63 | 64 | parseNodeToDom(root, data) { 65 | let fragment = document.createDocumentFragment(); 66 | let stack = [[root, fragment, data]]; 67 | //转成成node节点 68 | while (stack.length > 0) { 69 | let [pnode, pdom, scope] = stack.pop(); 70 | if (pnode.attr.get("for")) { 71 | let [key, prop] = pnode.attr.get("for").split("in"); 72 | key = key.trim(); 73 | prop = prop.trim(); 74 | for (let i = 0; i < scope[prop].length; i++) { 75 | let newnode = new Vnode( 76 | pnode.tag, 77 | pnode.attr, 78 | pnode.children, 79 | pnode.parent, 80 | pnode.childrenTemplate 81 | ); 82 | let newScope = {}; 83 | newScope[key] = scope[prop][i]; 84 | let html = this.scopehtmlParse(newnode, data, newScope); 85 | let ele = this.createElement(newnode, html); 86 | this.scopeAtrrParse(ele, newnode, data, newScope); 87 | pdom.parentNode.appendChild(ele); 88 | newnode.children.forEach((item) => { 89 | stack.push([item, ele, newScope]); 90 | }); 91 | } 92 | } else { 93 | let html = this.scopehtmlParse(pnode, data, scope); 94 | let ele = this.createElement(pnode, html); 95 | this.scopeAtrrParse(ele, pnode, data, scope); 96 | pdom.appendChild(ele); 97 | 98 | pnode.children.forEach((item) => { 99 | stack.push([item, ele, scope]); 100 | }); 101 | } 102 | } 103 | return fragment; 104 | } 105 | 106 | scopehtmlParse(node, globalScope, curentScope) { 107 | return node.childrenTemplate.replace(/\{\{(.*?)\}\}/g, (s0, s1) => { 108 | let props = s1.split("."); 109 | let val = curentScope[props[0]] || globalScope[props[0]]; 110 | props.slice(1).forEach((item) => { 111 | val = val[item]; 112 | }); 113 | return val; 114 | }); 115 | } 116 | 117 | scopeAtrrParse(ele, node, globalScope, curentScope) { 118 | console.log(node.attr); 119 | for (let [key, value] of node.attr) { 120 | let result = /\{\{(.*?)\}\}/.exec(value); 121 | if (result && result.length > 0) { 122 | let props = result[1].split("."); 123 | let val = curentScope[props[0]] || globalScope[props[0]]; 124 | props.slice(1).forEach((item) => { 125 | val = val[item]; 126 | }); 127 | ele.setAttribute(key, val); 128 | } 129 | } 130 | } 131 | 132 | createElement(node, html) { 133 | let ignoreAttr = ["for", "click"]; 134 | let dom = document.createElement(node.tag); 135 | for (let [key, val] of node.attr) { 136 | if (!ignoreAttr.includes(key)) { 137 | dom.setAttribute(key, val); 138 | } 139 | } 140 | if (node.children.length === 0) { 141 | dom.innerHTML = html; 142 | } 143 | return dom; 144 | } 145 | 146 | parseAttribute(str) { 147 | let attr = new Map(); 148 | str = str.trim(); 149 | str.replace(/(\w+)\s*=['"](.*?)['"]/gm, (s0, s1, s2) => { 150 | attr.set(s1, s2); 151 | return s0; 152 | }); 153 | return attr; 154 | } 155 | 156 | parseChildren(str) { 157 | str.replace(/\{\{(.*?)\}\}/gm, () => {}); 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /module1/code/src/components/FishTemplate/engine2.js: -------------------------------------------------------------------------------- 1 | import Vnode from "./vnode"; 2 | export default class Engine2 { 3 | render(tmpl, data) { 4 | let re = /<(\w+)\s*([^>]*)>([^<]*)<\/\1>/gm; 5 | while (re.test(tmpl)) { 6 | tmpl = tmpl.replace(re, (s0, s1, s2, s3) => { 7 | let node = new Vnode(s1, s2, [], null, s3); 8 | return `(node.uuid)`; 9 | }); 10 | } 11 | console.log("result result>>", tmpl); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /module1/code/src/components/FishTemplate/index.js: -------------------------------------------------------------------------------- 1 | export { default as V1 } from "./v1.js"; 2 | -------------------------------------------------------------------------------- /module1/code/src/components/FishTemplate/v1.js: -------------------------------------------------------------------------------- 1 | import Engine from "./engine"; 2 | export default class TemplateV1 { 3 | constructor() { 4 | this.root = null; 5 | this.engine = new Engine(); 6 | } 7 | 8 | render(com, data) { 9 | let dom = this.engine.render(com.render(), data); 10 | console.log("html>>>", dom); 11 | this.root.appendChild(dom); 12 | } 13 | 14 | mounted(dom) { 15 | this.root = dom; 16 | return this; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /module1/code/src/components/FishTemplate/v2.js: -------------------------------------------------------------------------------- 1 | import Engine from "./engine2"; 2 | export default class Template { 3 | constructor() { 4 | this.root = null; 5 | this.engine = new Engine(); 6 | } 7 | 8 | render(template, data) { 9 | let dom = this.engine.render(template, data); 10 | console.log(dom); 11 | this.root.appendChild(dom); 12 | } 13 | 14 | mounted(dom) { 15 | this.root = dom; 16 | return this; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /module1/code/src/components/FishTemplate/vnode.js: -------------------------------------------------------------------------------- 1 | export default class Vnode { 2 | constructor(tag, attr, children, parent, childrenTemplate) { 3 | this.tag = tag; 4 | this.attr = attr; 5 | this.children = children; 6 | this.parent = parent; 7 | this.childrenTemplate = childrenTemplate; 8 | this.uuid = this.uuid(); 9 | } 10 | 11 | uuid() { 12 | return ( 13 | Math.random() * 10000000000 + 14 | Math.random() * 100000 + 15 | Date.now() 16 | ).toString(36); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /module1/code/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import App from "./App.vue"; 3 | import router from "./router"; 4 | 5 | Vue.config.productionTip = false; 6 | 7 | new Vue({ 8 | router, 9 | render: (h) => h(App), 10 | }).$mount("#app"); 11 | -------------------------------------------------------------------------------- /module1/code/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import VueRouter from "vue-router"; 3 | import Home from "../views/Home.vue"; 4 | 5 | Vue.use(VueRouter); 6 | 7 | const routes = [ 8 | { 9 | path: "/", 10 | name: "Home", 11 | component: Home, 12 | }, 13 | { 14 | path: "/arraysort", 15 | name: "arraysort", 16 | component: () => 17 | import(/* webpackChunkName: "arraysort" */ "../views/ArraySort.vue"), 18 | }, 19 | { 20 | path: "/clipboard", 21 | name: "clipboard", 22 | component: () => 23 | import(/* webpackChunkName: "clipboard" */ "../views/Clipboard.vue"), 24 | }, 25 | { 26 | path: "/geolocation", 27 | name: "geolocation", 28 | component: () => 29 | import(/* webpackChunkName: "geolocation" */ "../views/Geolocation.vue"), 30 | }, 31 | { 32 | path: "/keyboard", 33 | name: "keyboard", 34 | component: () => 35 | import(/* webpackChunkName: "keyboard" */ "../views/Keyboard.vue"), 36 | }, 37 | { 38 | path: "/webrtc", 39 | name: "webrtc", 40 | component: () => 41 | import(/* webpackChunkName: "voiceChat" */ "../views/WebRTC.vue"), 42 | }, 43 | { 44 | path: "/shortUrl", 45 | name: "shortUrl", 46 | component: () => 47 | import(/* webpackChunkName: "shortUrl" */ "../views/ShortURL.vue"), 48 | }, 49 | { 50 | path: "/webRTCScreenShot", 51 | name: "webRTCScreenShot", 52 | component: () => 53 | import( 54 | /* webpackChunkName: "webRTCScreenShot" */ "../views/WebRTCScreenShot.vue" 55 | ), 56 | }, 57 | { 58 | path: "/webWorker", 59 | name: "webWorker", 60 | component: () => 61 | import(/* webpackChunkName: "webWorker" */ "../views/WebWorker.vue"), 62 | }, 63 | { 64 | path: "/lasyImage", 65 | name: "lasyImage", 66 | component: () => 67 | import(/* webpackChunkName: "lasyImage" */ "../views/LasyImage.vue"), 68 | }, 69 | { 70 | path: "/imageGrid", 71 | name: "imageGrid", 72 | component: () => 73 | import(/* webpackChunkName: "imageGrid" */ "../views/ImageGrid.vue"), 74 | }, 75 | { 76 | path: "/floatToBinary", 77 | name: "floatToBinary", 78 | component: () => 79 | import(/* webpackChunkName: "lab" */ "../views/FloatToBinary.vue"), 80 | }, 81 | { 82 | path: "/lessTheme", 83 | name: "lessTheme", 84 | component: () => 85 | import(/* webpackChunkName: "lab" */ "../views/LessTheme.vue"), 86 | }, 87 | { 88 | path: "/fishTemplate", 89 | name: "fishTemplate", 90 | component: () => 91 | import( 92 | /* webpackChunkName: "fishTemplate" */ "../views/FishTemplate.vue" 93 | ), 94 | }, 95 | { 96 | path: "/bitmask", 97 | name: "bitmask", 98 | component: () => 99 | import(/* webpackChunkName: "bitmask" */ "../views/BitMask.vue"), 100 | }, 101 | { 102 | path: "/memory", 103 | name: "memory", 104 | component: () => 105 | import(/* webpackChunkName: "memory" */ "../views/Memory.vue"), 106 | }, 107 | { 108 | path: "/lab", 109 | name: "lab", 110 | component: () => import(/* webpackChunkName: "lab" */ "../views/Lab.vue"), 111 | }, 112 | ]; 113 | 114 | const router = new VueRouter({ 115 | routes, 116 | }); 117 | 118 | export default router; 119 | -------------------------------------------------------------------------------- /module1/code/src/serviceworker.js: -------------------------------------------------------------------------------- 1 | workbox.core.setCacheNameDetails({ 2 | prefix: "workbox", 3 | suffix: "v1", 4 | precache: "precache", 5 | runtime: "runtime-cache", 6 | }); 7 | 8 | workbox.core.skipWaiting(); 9 | workbox.core.clientsClaim(); 10 | 11 | workbox.precaching.precacheAndRoute(self.__precacheManifest); 12 | 13 | // JS 请求: 网络优先 14 | workbox.routing.registerRoute( 15 | new RegExp("index.html"), 16 | workbox.strategies.networkFirst({ 17 | cacheName: "workbox:html", 18 | }) 19 | ); 20 | 21 | // JS 请求: 网络优先 22 | workbox.routing.registerRoute( 23 | new RegExp(".*.js"), 24 | workbox.strategies.networkFirst({ 25 | cacheName: "workbox:js", 26 | }) 27 | ); 28 | 29 | // CSS 请求: 缓存优先,同时后台更新后下次打开页面才会被页面使用 30 | workbox.routing.registerRoute( 31 | // Cache CSS files 32 | /.*\.css/, 33 | // Use cache but update in the background ASAP 34 | workbox.strategies.staleWhileRevalidate({ 35 | // Use a custom cache name 36 | cacheName: "workbox:css", 37 | }) 38 | ); 39 | 40 | // 图片请求: 缓存优先 41 | workbox.routing.registerRoute( 42 | // Cache image files 43 | /.*\.(?:png|jpg|jpeg|svg|gif)/, 44 | // Use the cache if it's available 45 | workbox.strategies.cacheFirst({ 46 | // Use a custom cache name 47 | cacheName: "workbox:image", 48 | plugins: [ 49 | new workbox.expiration.Plugin({ 50 | // Cache only 20 images 51 | maxEntries: 20, 52 | // Cache for a maximum of a week 53 | maxAgeSeconds: 7 * 24 * 60 * 60, 54 | // Automatically cleanup if quota is exceeded. 55 | purgeOnQuotaError: true, 56 | }), 57 | ], 58 | }) 59 | ); 60 | -------------------------------------------------------------------------------- /module1/code/src/views/ArraySort.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 70 | 71 | 83 | -------------------------------------------------------------------------------- /module1/code/src/views/BitMask.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 123 | -------------------------------------------------------------------------------- /module1/code/src/views/CatDomNode.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 40 | -------------------------------------------------------------------------------- /module1/code/src/views/Clipboard.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 79 | 80 | 91 | -------------------------------------------------------------------------------- /module1/code/src/views/Clock.worker.js: -------------------------------------------------------------------------------- 1 | var time = 0; 2 | self.onmessage = (e) => { 3 | console.log("worker接受到的message e--", e.data); 4 | if (e.data.start) { 5 | setInterval(() => { 6 | time++; 7 | self.postMessage({ time: time }); 8 | }, 1000); 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /module1/code/src/views/FishTemplate.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 56 | 57 | 65 | -------------------------------------------------------------------------------- /module1/code/src/views/FloatToBinary.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /module1/code/src/views/Geolocation.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /module1/code/src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 32 | 33 | 60 | -------------------------------------------------------------------------------- /module1/code/src/views/ImageGrid.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 44 | 45 | 115 | -------------------------------------------------------------------------------- /module1/code/src/views/IndexedDB.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 110 | 111 | 157 | -------------------------------------------------------------------------------- /module1/code/src/views/Keyboard.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 56 | -------------------------------------------------------------------------------- /module1/code/src/views/Lab.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 40 | -------------------------------------------------------------------------------- /module1/code/src/views/LasyImage.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 64 | 65 | 86 | -------------------------------------------------------------------------------- /module1/code/src/views/LessTheme.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 75 | 76 | 111 | -------------------------------------------------------------------------------- /module1/code/src/views/Memory.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 40 | 41 | 46 | -------------------------------------------------------------------------------- /module1/code/src/views/SeviceWorker.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/src/views/SeviceWorker.vue -------------------------------------------------------------------------------- /module1/code/src/views/ShortURL.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 179 | 180 | 205 | -------------------------------------------------------------------------------- /module1/code/src/views/VoiceChat.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/code/src/views/VoiceChat.vue -------------------------------------------------------------------------------- /module1/code/src/views/WebRTC.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 163 | 164 | 182 | -------------------------------------------------------------------------------- /module1/code/src/views/WebRTCScreenShot.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 63 | 64 | 73 | -------------------------------------------------------------------------------- /module1/code/src/views/WebWorker.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 39 | -------------------------------------------------------------------------------- /module1/code/tests/unit/engine2.spec.js: -------------------------------------------------------------------------------- 1 | import { shallowMount } from "@vue/test-utils"; 2 | import Engine2 from "@/components/FishTemplate/engine2.js"; 3 | import Vnode from "@/components/FishTemplate/vnode.js"; 4 | 5 | describe("engine.js", () => { 6 | it("Engine2 render", () => { 7 | const engine = new Engine2(); 8 | let nodes = engine.render( 9 | `
10 | {{hello}} 11 |
`, 12 | { hello: "hello,world" } 13 | ); 14 | console.log(nodes); 15 | }); 16 | }); 17 | 18 | describe("engine.js", () => { 19 | it("Engine2 render", () => { 20 | const engine = new Engine2(); 21 | let nodes = engine.render( 22 | `
23 |
24 | {{item.title}} 25 |
26 |
`, 27 | { newslist: [{ title: "a" }, { title: "a" }] } 28 | ); 29 | console.log(nodes); 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /module1/code/tests/unit/vnode.spec.js: -------------------------------------------------------------------------------- 1 | import { shallowMount } from "@vue/test-utils"; 2 | import Engine from "@/components/FishTemplate/engine.js"; 3 | import Vnode from "@/components/FishTemplate/vnode.js"; 4 | 5 | describe("engine.js", () => { 6 | it("engine render", () => { 7 | const engine = new Engine(); 8 | let nodes = engine.render( 9 | "
{{ item.name }}
", 10 | { 11 | newslist: [{ name: "Google" }, { name: "Apple" }, { name: "Oracle" }], 12 | } 13 | ); 14 | console.log(nodes); 15 | }); 16 | }); 17 | 18 | describe("engine.js", () => { 19 | it("engine render2", () => { 20 | const engine = new Engine(); 21 | let nodes = engine.render( 22 | `
23 |
24 |
25 |
{{item.title}}
26 |
27 |
`, 28 | { 29 | newslist: [ 30 | { title: "Google", img: "img1" }, 31 | { title: "Apple", img: "img2" }, 32 | { title: "Oracle", img: "img3" }, 33 | ], 34 | } 35 | ); 36 | console.log(nodes); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /module1/code/vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | pwa: { 3 | name: "FeCourse", 4 | themeColor: "#4DBA87", 5 | msTileColor: "#000000", 6 | appleMobileWebAppCapable: "yes", 7 | appleMobileWebAppStatusBarStyle: "black", 8 | 9 | // configure the workbox plugin 10 | workboxPluginMode: "InjectManifest", 11 | workboxOptions: { 12 | // swSrc is required in InjectManifest mode. 13 | swSrc: "./src/serviceworker.js", 14 | swDest: "sw.js", 15 | globDirectory: "./dist/", 16 | globPatterns: ["**/*.{js,css,png,jpg,jpeg,svg,gif}"], 17 | importWorkboxFrom: "local", //cdn,local 18 | }, 19 | }, 20 | }; 21 | -------------------------------------------------------------------------------- /module1/mvvm/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/mvvm/.DS_Store -------------------------------------------------------------------------------- /module1/mvvm/component/Todo.js: -------------------------------------------------------------------------------- 1 | export default { 2 | data() { 3 | let events = []; 4 | for (let i = 0; i < 20; i++) { 5 | events.push({ id: i, todo: `JSX编译库-${i}`, state: i % 2 ? 1 : 2 }) 6 | } 7 | return { 8 | events: events, 9 | } 10 | }, 11 | render() { 12 | return ` 13 |
14 |

{this.dateTime} - todo

15 |
    16 | { 17 | if(this.events.length > 0){ 18 | this.events.map(item => { 19 | if(item.state == 2){ 20 | return
  • {item.todo}
  • 21 | } else { 22 | return
  • {item.todo}
  • 23 | } 24 | }) 25 | } else if(this.events.length == 0){ 26 | return '暂无数据'; 27 | } 28 | } 29 |
30 |

目前问题

31 |
    32 |
  • 标签属性没有动态绑定
  • 33 |
  • 标签事件没有动态绑定
  • 34 |
  • 还不支持自定义标签
  • 35 |
  • 还不支持Map嵌套
  • 36 |
37 |
38 | ` 39 | }, 40 | created() { 41 | 42 | }, 43 | mounted() { 44 | 45 | }, 46 | methods: { 47 | itemClick(e) { 48 | 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /module1/mvvm/core/Func.js: -------------------------------------------------------------------------------- 1 | export default class Func { 2 | constructor(execute, params, context){ 3 | this.execute = execute; 4 | this.params = params; 5 | this.context = context; 6 | } 7 | } -------------------------------------------------------------------------------- /module1/mvvm/core/Rv.js: -------------------------------------------------------------------------------- 1 | import VNode from './Vnode.js'; 2 | import Func from './Func.js'; 3 | import Render from './render.js'; 4 | 5 | export default class Rv { 6 | 7 | constructor(com, props, dom) { 8 | this.root = dom; 9 | this.props = Object.assign({}, props); 10 | this.com = com; 11 | 12 | this.nodeStack = []; 13 | this.funcStack = []; 14 | 15 | this.com.created(); 16 | } 17 | 18 | render() { 19 | this.state = this.com.data(); 20 | let template = this.com.render(); 21 | let methods = this.com.methods; 22 | let data = Object.assign(this.state, this.props); 23 | this.r = new Render(data, methods); 24 | this.compile(template); 25 | this.com.mounted(); 26 | } 27 | 28 | compile(template) { 29 | let me = this; 30 | template = template.replace(/\s{2,}/mg, ' '); 31 | let html = me.compileTag(template); 32 | console.time('render'); 33 | let result = this.r.render(me.nodeStack, me.funcStack, html); 34 | console.timeEnd('render'); 35 | this.root.innerText = html; 36 | } 37 | 38 | compileTag(template) { 39 | let me = this; 40 | let html = template; 41 | 42 | while (/<(\w+)\s*([^>]*)>([^<]*)<\/\1>/.test(html)) { 43 | html = html.replace(/<(\w+)\s*([^>]*)>([^<]*)<\/\1>/g, function (s0, s1, s2, s3) { 44 | let tag = s1; 45 | let attr = s2; 46 | let children = me.compileVariables(s3); 47 | let node = new VNode(tag, attr, children); 48 | me.nodeStack.push(node); 49 | return 'this.$create(' + (me.nodeStack.length - 1) + ') '; 50 | }); 51 | } 52 | console.log('✈️', me.nodeStack); 53 | console.log('✈️', me.funcStack); 54 | return html; 55 | } 56 | 57 | compileVariables(template) { 58 | let me = this; 59 | let html = template.trim(); 60 | if (!html) return ''; 61 | html = html.replace(/\n/mg, ''); 62 | 63 | if (!/^this\.\$create\(/.test(html)) { 64 | html = html.replace("'", "\'"); 65 | html = html.replace('"', '\"'); 66 | 67 | if (/\{\s*if\s*\(/.test(html)) { 68 | // IF 69 | me.funcStack.push(new Func('$evaluateIf', html)); 70 | html = "this.$evaluateIf(" + (me.funcStack.length - 1) + ")"; 71 | } else if (/\{\s*(.*?)\.map\(([^=]*)=>\s*{/.test(html)) { 72 | // map 73 | let mats = /\{(.*?)\.map\(([^=]*)=>\s*{/.exec(html); 74 | if (mats.length == 3) { 75 | me.funcStack.push(new Func('$evaluateMap', html, mats[2].trim())); 76 | html = "this.$evaluateMap(" + (me.funcStack.length - 1) + ")"; 77 | } 78 | } else { 79 | me.funcStack.push(new Func('$evaluate', html)); 80 | html = "this.$evaluate(" + (me.funcStack.length - 1) + ")"; 81 | } 82 | return html; 83 | } else { 84 | return html; 85 | } 86 | } 87 | 88 | getValue(key, data) { 89 | let newkey = key.replace('this.state', '').replace('this.props', ''); 90 | return newKey.trim().split('.').reduce((last, item) => { 91 | return last[item]; 92 | }, data); 93 | } 94 | 95 | 96 | } 97 | 98 | -------------------------------------------------------------------------------- /module1/mvvm/core/Vnode.js: -------------------------------------------------------------------------------- 1 | export default class Vnode { 2 | constructor(tag, props, children) { 3 | this.tag = tag; 4 | this.props = props; 5 | this.children = children; 6 | } 7 | } -------------------------------------------------------------------------------- /module1/mvvm/core/index.js: -------------------------------------------------------------------------------- 1 | import Rv from './Rv.js'; 2 | 3 | export default { 4 | render(com, props, dom) { 5 | let rv = new Rv(com, props, dom); 6 | rv.render(); 7 | } 8 | } -------------------------------------------------------------------------------- /module1/mvvm/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Demo 11 | 12 | 13 | 14 | 15 |
16 | 17 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /module1/mvvm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mvvm", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "dependencies": { 7 | "express": "^4.17.1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /module1/mvvm/server.js: -------------------------------------------------------------------------------- 1 | const express = require('express') 2 | const app = express() 3 | const port = 5000 4 | 5 | console.log(__dirname); 6 | app.use(express.static(__dirname)) 7 | 8 | app.listen(port, () => { 9 | console.log(`Example app listening at http://localhost:${port}`) 10 | }) -------------------------------------------------------------------------------- /module1/pwa/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | -------------------------------------------------------------------------------- /module1/pwa/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true, 5 | }, 6 | extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"], 7 | parserOptions: { 8 | parser: "babel-eslint", 9 | }, 10 | rules: { 11 | "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", 12 | "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", 13 | }, 14 | overrides: [ 15 | { 16 | files: [ 17 | "**/__tests__/*.{j,t}s?(x)", 18 | "**/tests/unit/**/*.spec.{j,t}s?(x)", 19 | ], 20 | env: { 21 | jest: true, 22 | }, 23 | }, 24 | ], 25 | }; 26 | -------------------------------------------------------------------------------- /module1/pwa/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /module1/pwa/README.md: -------------------------------------------------------------------------------- 1 | # pwa 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn build 16 | ``` 17 | 18 | ### Run your unit tests 19 | ``` 20 | yarn test:unit 21 | ``` 22 | 23 | ### Lints and fixes files 24 | ``` 25 | yarn lint 26 | ``` 27 | 28 | ### Customize configuration 29 | See [Configuration Reference](https://cli.vuejs.org/config/). 30 | -------------------------------------------------------------------------------- /module1/pwa/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ["@vue/cli-plugin-babel/preset"], 3 | }; 4 | -------------------------------------------------------------------------------- /module1/pwa/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: "@vue/cli-plugin-unit-jest", 3 | }; 4 | -------------------------------------------------------------------------------- /module1/pwa/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pwa", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "test:unit": "vue-cli-service test:unit", 9 | "lint": "vue-cli-service lint" 10 | }, 11 | "dependencies": { 12 | "core-js": "^3.6.5", 13 | "vue": "^2.6.11" 14 | }, 15 | "devDependencies": { 16 | "@vue/cli-plugin-babel": "~4.5.0", 17 | "@vue/cli-plugin-eslint": "~4.5.0", 18 | "@vue/cli-plugin-pwa": "^4.5.13", 19 | "@vue/cli-plugin-unit-jest": "~4.5.0", 20 | "@vue/cli-service": "~4.5.0", 21 | "@vue/eslint-config-prettier": "^6.0.0", 22 | "@vue/test-utils": "^1.0.3", 23 | "babel-eslint": "^10.1.0", 24 | "eslint": "^6.7.2", 25 | "eslint-plugin-prettier": "^3.3.1", 26 | "eslint-plugin-vue": "^6.2.2", 27 | "less": "^3.0.4", 28 | "less-loader": "^5.0.0", 29 | "prettier": "^2.2.1", 30 | "vue-template-compiler": "^2.6.11" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /module1/pwa/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/pwa/public/favicon.ico -------------------------------------------------------------------------------- /module1/pwa/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /module1/pwa/src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 18 | 19 | 29 | -------------------------------------------------------------------------------- /module1/pwa/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin-xi/fe-course/4bb7b81a33085009fb3df6e7706228fb8f2f45f5/module1/pwa/src/assets/logo.png -------------------------------------------------------------------------------- /module1/pwa/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 96 | 97 | 105 | 106 | 107 | 123 | -------------------------------------------------------------------------------- /module1/pwa/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import App from "./App.vue"; 3 | 4 | Vue.config.productionTip = false; 5 | 6 | new Vue({ 7 | render: (h) => h(App), 8 | }).$mount("#app"); 9 | -------------------------------------------------------------------------------- /module1/pwa/tests/unit/example.spec.js: -------------------------------------------------------------------------------- 1 | import { shallowMount } from "@vue/test-utils"; 2 | import HelloWorld from "@/components/HelloWorld.vue"; 3 | 4 | describe("HelloWorld.vue", () => { 5 | it("renders props.msg when passed", () => { 6 | const msg = "new message"; 7 | const wrapper = shallowMount(HelloWorld, { 8 | propsData: { msg }, 9 | }); 10 | expect(wrapper.text()).toMatch(msg); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /module1/pwa/vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | pwa: { 3 | name: "pwa", 4 | themeColor: "#4DBA87", 5 | msTileColor: "#000000", 6 | appleMobileWebAppCapable: "yes", 7 | appleMobileWebAppStatusBarStyle: "black", 8 | 9 | // configure the workbox plugin 10 | workboxPluginMode: "GenerateSW", 11 | workboxOptions: { 12 | cacheId: "vue-pwa", // 设置前缀 13 | skipWaiting: true, // 强制等待中的 Service Worker 被激活 14 | clientsClaim: true, // Service Worker 被激活后使其立即获得页面控制权 15 | swDest: "service-wroker.js", // 输出 Service worker 文件 16 | globPatterns: ["**/*.{js,css,png,jpg,jpeg,svg,gif}"], // 匹配的文件 17 | globIgnores: ["service-wroker.js"], // 忽略的文件 18 | runtimeCaching: [ 19 | { 20 | urlPattern: /index\.html/, 21 | handler: "networkFirst", 22 | }, 23 | // 配置路由请求缓存 24 | { 25 | urlPattern: /.*\.js/, // 匹配文件 26 | handler: "networkFirst", // 网络优先 27 | }, 28 | { 29 | urlPattern: /.*\.css/, // 匹配文件 30 | handler: "staleWhileRevalidate", // 网络优先 31 | }, 32 | { 33 | urlPattern: /.*\.(?:png|jpg|jpeg|svg|gif)/, // 匹配文件 34 | handler: "cacheFirst", // 网络优先 35 | }, 36 | ], 37 | }, 38 | }, 39 | }; 40 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | balanced-match@^1.0.0: 6 | version "1.0.2" 7 | resolved "https://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.2.tgz?cache=0&sync_timestamp=1617714298273&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbalanced-match%2Fdownload%2Fbalanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" 8 | integrity sha1-6D46fj8wCzTLnYf2FfoMvzV2kO4= 9 | 10 | brace-expansion@^1.1.7: 11 | version "1.1.11" 12 | resolved "https://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" 13 | integrity sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0= 14 | dependencies: 15 | balanced-match "^1.0.0" 16 | concat-map "0.0.1" 17 | 18 | concat-map@0.0.1: 19 | version "0.0.1" 20 | resolved "https://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 21 | integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= 22 | 23 | minimatch@^3.0.4: 24 | version "3.0.4" 25 | resolved "https://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" 26 | integrity sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM= 27 | dependencies: 28 | brace-expansion "^1.1.7" 29 | 30 | serviceworker-webpack-plugin@^1.0.1: 31 | version "1.0.1" 32 | resolved "https://registry.nlark.com/serviceworker-webpack-plugin/download/serviceworker-webpack-plugin-1.0.1.tgz#481863288487e92da01d49745336c72ef8a6136b" 33 | integrity sha1-SBhjKISH6S2gHUl0UzbHLvimE2s= 34 | dependencies: 35 | minimatch "^3.0.4" 36 | --------------------------------------------------------------------------------