forked from hoppscotch/hoppscotch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "Migrate Postwoman to Nuxt.js (full Vue and SCSS suppo…
…rt)""
- Loading branch information
1 parent
dbcd744
commit b027eeb
Showing
39 changed files
with
12,054 additions
and
816 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,91 @@ | ||
node_modules | ||
# Created by .ignore support plugin (hsz.mobi) | ||
### Node template | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# Nuxt generate | ||
dist | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless | ||
|
||
# IDE / Editor | ||
.idea | ||
.editorconfig | ||
|
||
# Service worker | ||
sw.* | ||
|
||
# Mac OSX | ||
.DS_Store | ||
|
||
# Vim swap files | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# ASSETS | ||
|
||
**This directory is not required, you can delete it if you don't want to use it.** | ||
|
||
This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. | ||
|
||
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Poppins (Google Fonts) | ||
@import url("https://fonts.googleapis.com/css?family=Poppins:500,700&display=swap"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
export default () => { | ||
//*** Determine whether or not the PWA has been installed. ***// | ||
|
||
// Step 1: Check local storage | ||
let pwaInstalled = localStorage.getItem('pwaInstalled') === 'yes'; | ||
|
||
// Step 2: Check if the display-mode is standalone. (Only permitted for PWAs.) | ||
if (!pwaInstalled && window.matchMedia('(display-mode: standalone)').matches) { | ||
localStorage.setItem('pwaInstalled', 'yes'); | ||
pwaInstalled = true; | ||
} | ||
|
||
// Step 3: Check if the navigator is in standalone mode. (Again, only permitted for PWAs.) | ||
if (!pwaInstalled && window.navigator.standalone === true) { | ||
localStorage.setItem('pwaInstalled', 'yes'); | ||
pwaInstalled = true; | ||
} | ||
|
||
//*** If the PWA has not been installed, show the install PWA prompt.. ***// | ||
let deferredPrompt = null; | ||
window.addEventListener('beforeinstallprompt', (event) => { | ||
deferredPrompt = event; | ||
|
||
// Show the install button if the prompt appeared. | ||
if (!pwaInstalled) { | ||
document.querySelector('#installPWA').style.display = 'block'; | ||
} | ||
}); | ||
|
||
// When the app is installed, remove install prompts. | ||
window.addEventListener('appinstalled', (event) => { | ||
localStorage.setItem('pwaInstalled', 'yes'); | ||
pwaInstalled = true; | ||
document.getElementById('installPWA').style.display = 'none'; | ||
}); | ||
|
||
// When the app is uninstalled, add the prompts back | ||
|
||
|
||
return async () => { | ||
if (deferredPrompt) { | ||
deferredPrompt.prompt(); | ||
let outcome = await deferredPrompt.userChoice; | ||
|
||
if (outcome === 'accepted') { | ||
console.log('Postwoman was installed successfully.') | ||
} else { | ||
console.log('Postwoman could not be installed. (Installation rejected by user.)') | ||
} | ||
deferredPrompt = null; | ||
} | ||
}; | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# COMPONENTS | ||
|
||
**This directory is not required, you can delete it if you don't want to use it.** | ||
|
||
The components directory contains your Vue.js Components. | ||
|
||
_Nuxt.js doesn't supercharge these components._ |
Oops, something went wrong.