Browse Source

👽 Vue-ify Postwoman with Nuxt.js!

NBTX 5 years ago
parent
commit
a27be71b13
10 changed files with 192 additions and 497 deletions
  1. 91 70
      .gitignore
  2. 0 2
      .idea/.gitignore
  3. 0 88
      404.html
  4. 23 13
      README.md
  5. 7 0
      assets/README.md
  6. 2 0
      assets/css/fonts.scss
  7. 11 5
      assets/css/styles.scss
  8. 51 0
      assets/js/pwa.js
  9. 7 0
      components/README.md
  10. 0 319
      index.html

+ 91 - 70
.gitignore

@@ -1,70 +1,91 @@
-node_modules
-
-# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
-# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
-
-# User-specific stuff
-.idea/**/workspace.xml
-.idea/**/tasks.xml
-.idea/**/usage.statistics.xml
-.idea/**/dictionaries
-.idea/**/shelf
-
-# Generated files
-.idea/**/contentModel.xml
-
-# Sensitive or high-churn files
-.idea/**/dataSources/
-.idea/**/dataSources.ids
-.idea/**/dataSources.local.xml
-.idea/**/sqlDataSources.xml
-.idea/**/dynamic.xml
-.idea/**/uiDesigner.xml
-.idea/**/dbnavigator.xml
-
-# Gradle
-.idea/**/gradle.xml
-.idea/**/libraries
-
-# Gradle and Maven with auto-import
-# When using Gradle or Maven with auto-import, you should exclude module files,
-# since they will be recreated, and may cause churn.  Uncomment if using
-# auto-import.
-# .idea/modules.xml
-# .idea/*.iml
-# .idea/modules
-# *.iml
-# *.ipr
-
-# CMake
-cmake-build-*/
-
-# Mongo Explorer plugin
-.idea/**/mongoSettings.xml
-
-# File-based project format
-*.iws
-
-# IntelliJ
-out/
-
-# mpeltonen/sbt-idea plugin
-.idea_modules/
-
-# JIRA plugin
-atlassian-ide-plugin.xml
-
-# Cursive Clojure plugin
-.idea/replstate.xml
-
-# Crashlytics plugin (for Android Studio and IntelliJ)
-com_crashlytics_export_strings.xml
-crashlytics.properties
-crashlytics-build.properties
-fabric.properties
-
-# Editor-based Rest Client
-.idea/httpRequests
-
-# Android studio 3.1+ serialized cache file
-.idea/caches/build_file_checksums.ser
+# 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

+ 0 - 2
.idea/.gitignore

@@ -1,2 +0,0 @@
-# Default ignored files
-/workspace.xml

+ 0 - 88
404.html

@@ -1,88 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-  <meta charset='utf-8'>
-  <meta http-equiv="X-UA-Compatible" content="IE=edge">
-  <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, shrink-to-fit=no">
-  <title>Postwoman - API request builder</title>
-  <meta name="description" content="The Postwoman API request builder helps you create your requests faster, saving you precious time on your development.">
-  <link rel="icon" href="favicon.ico">
-  <meta itemprop="name" content="Postwoman - API request builder">
-  <meta itemprop="description" content="The Postwoman API request builder helps you create your requests faster, saving you precious time on your development.">
-  <meta itemprop="image" content="icons/icon-192x192.png">
-  <!-- See https://goo.gl/OOhYW5 -->
-  <link rel="manifest" href="manifest.json">
-  <!-- See https://goo.gl/qRE0vM -->
-  <meta name="theme-color" content="#121212">
-  <!-- Add to homescreen for Chrome on Android. Fallback for manifest.json -->
-  <meta name="mobile-web-app-capable" content="yes">
-  <meta name="application-name" content="Postwoman - API request builder">
-  <!-- Add to homescreen for Safari on iOS -->
-  <meta name="apple-mobile-web-app-capable" content="yes">
-  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
-  <meta name="apple-mobile-web-app-title" content="Postwoman - API request builder">
-  <!-- Homescreen icons -->
-  <link rel="apple-touch-icon" href="icons/icon-48x48.png">
-  <link rel="apple-touch-icon" sizes="72x72" href="icons/icon-72x72.png">
-  <link rel="apple-touch-icon" sizes="96x96" href="icons/icon-96x96.png">
-  <link rel="apple-touch-icon" sizes="144x144" href="icons/icon-144x144.png">
-  <link rel="apple-touch-icon" sizes="192x192" href="icons/icon-192x192.png">
-  <!-- Tile icon for Windows 8 (144x144 + tile color) -->
-  <meta name="msapplication-TileImage" content="icons/icon-144x144.png">
-  <meta name="msapplication-TileColor" content="#121212">
-  <meta name="msapplication-tap-highlight" content="no">
-  <!-- OpenGraph -->
-  <meta property="og:site_name" content="Postwoman - API request builder">
-  <meta property="og:url" content="https://liyasthomas.github.io/postwoman">
-  <meta property="og:type" content="website">
-  <meta property="og:title" content="Postwoman - API request builder">
-  <meta property="og:description" content="API request builder">
-  <meta property="og:image" content="icons/icon-144x144.png">
-  <!-- Twitter -->
-  <meta name="twitter:card" content="summary">
-  <meta name="twitter:site" content="@liyasthomas">
-  <meta name="twitter:creator" content="@liyasthomas">
-  <meta name="twitter:url" content="https://liyasthomas.github.io/postwoman">
-  <meta name="twitter:title" content="Postwoman - API request builder">
-  <meta name="twitter:description" content="API request builder">
-  <meta name="twitter:image" content="icons/icon-144x144.png">
-  <!-- Web Fonts -->
-  <link href="https://fonts.googleapis.com/css?family=Poppins:500,700&display=swap" rel="stylesheet">
-  <link rel="stylesheet" href="style.css">
-  <script>
-    if ('serviceWorker' in navigator) {
-      window.addEventListener('load', function() {
-        navigator.serviceWorker.register('sw.js').then(function(registration) {
-          console.log('ServiceWorker registration successful with scope: ', registration.scope);
-        }).catch(function(err) {
-          console.log('ServiceWorker registration failed: ', err);
-        });
-      });
-    }
-
-  </script>
-</head>
-
-<body>
-  <main id="app">
-    <header>
-      <div>
-        <a href="index.html">
-          <h1 class="logo"><img src="icons/logo.svg" alt="" style="height: 24px; margin-right: 16px">Postwoman</h1>
-        </a>
-        <h3>API request builder</h3>
-      </div>
-    </header>
-    <h1>404 - Page not found</h1>
-    <p><a href="index.html"><button>Go Home</button></a></p>
-    <footer>
-      <a href="https://github.com/liyasthomas/postwoman" target="_blank"><img src="icons/github.svg" alt="" style="margin-right: 16px">GitHub</a>
-      <button id="installPWA" onclick="installPWA()">
-        Install PWA
-      </button>
-    </footer>
-  </main>
-</body>
-
-</html>

+ 23 - 13
README.md

@@ -2,27 +2,27 @@
 When I wrote this, only God and I understood what I was doing. Now, only God knows.
 ```
 <div align="center">
-  <a href="https://liyas-thomas.firebaseapp.com"><img src="https://raw.githubusercontent.com/liyasthomas/templates/master/assets/logo.gif" alt="Liyas Thomas" width="200"></a>
-  <br>
-  <h1>Liyas Thomas</h1>
-  <sub>Built with ❤︎ by
-  <a href="https://github.com/liyasthomas">liyasthomas</a> and
-  <a href="https://github.com/liyasthomas/postwoman/graphs/contributors">contributors</a>
-	</sub>
+    <a href="https://liyas-thomas.firebaseapp.com"><img src="https://raw.githubusercontent.com/liyasthomas/templates/master/assets/logo.gif" alt="Liyas Thomas" width="200"></a>
+    <br>
+    <h1>Liyas Thomas</h1>
+    <sub>Built with ❤︎ by
+      <a href="https://github.com/liyasthomas">liyasthomas</a> and
+      <a href="https://github.com/liyasthomas/postwoman/graphs/contributors">contributors</a>
+    </sub>
 </div>
 
 ---
 
 [![Build Status](https://travis-ci.org/liyasthomas/postwoman.svg?branch=master)](https://travis-ci.org/liyasthomas/postwoman) [![GitHub release](https://img.shields.io/github/release/liyasthomas/postwoman/all.svg)](https://github.com/liyasthomas/postwoman/releases/latest) [![repo size](https://img.shields.io/github/repo-size/liyasthomas/postwoman.svg)](https://github.com/liyasthomas/postwoman/archive/master.zip) [![license](https://img.shields.io/github/license/liyasthomas/postwoman.svg)](https://github.com/liyasthomas/postwoman/blob/master/LICENSE) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/liyasthomas/postwoman/issues) [![Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=website)](https://liyas-thomas.firebaseapp.com) [![Donate](https://img.shields.io/badge/$-donate-ff69b4.svg)](https://www.paypal.me/liyascthomas) [![Buy me a coffee](https://img.shields.io/badge/$-BuyMeACoffee-orange.svg)](https://www.buymeacoffee.com/liyasthomas)
 
-# <img src="icons/icon-48x48.png" alt="postwoman" width="32"> Postwoman
+# <img src="static/icon.png" alt="postwoman" width="32"> Postwoman
 
 ### 👽 API request builder by [Liyas Thomas](https://github.com/liyasthomas)
 
 <div align="center">
   <br>
-  <img src="icons/screely.png" alt="postwoman" width="100%">
-  <img src="icons/screely2.png" alt="postwoman" width="100%">
+  <img src="static/screely.png" alt="postwoman" width="100%">
+  <img src="static/screely2.png" alt="postwoman" width="100%">
   <br>
 </div>
 
@@ -58,15 +58,25 @@ You're done!
 * HTML - For the web framework
 * CSS - For styling components
 * JavaScript - For magic!
+* [Vue](https://vuejs.org/) - To add to the JavaScript magic!
+* [Nuxt](https://nuxtjs.org/) - To add to the Vue magic! <!-- (Nuxt helps create the PWA and single page application.) -->
 
 ---
 
 ## Developing
 
 1. [Clone this repo](https://help.github.com/en/articles/cloning-a-repository) with git.
-1. Install dependencies by running `npm install` within the `postwoman` directory.
-1. Start the development server with `npm start`.
-1. Open development site by going to [http://localhost:8080](http://localhost:8080) in your browser.
+1. Install dependencies by running `npm install` within the directory that you cloned (probably `postwoman`).
+1. Start the development server with `npm run dev`.
+1. Open development site by going to [http://localhost:3000](http://localhost:3000) in your browser.
+
+---
+
+## Releasing
+1. [Clone this repo](https://help.github.com/en/articles/cloning-a-repository) with git.
+1. Install dependencies by running `npm install` within the directory that you cloned (probably `postwoman`).
+1. Build the release files with `npm run build`.
+1. Find the built project in `./dist`.
 
 ---
 

+ 7 - 0
assets/README.md

@@ -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).

+ 2 - 0
assets/css/fonts.scss

@@ -0,0 +1,2 @@
+// Poppins (Google Fonts)
+@import url("https://fonts.googleapis.com/css?family=Poppins:500,700&display=swap");

+ 11 - 5
style.css → assets/css/styles.scss

@@ -70,13 +70,15 @@ footer {
   justify-content: space-between;
 }
 
-.logo {
-  color: var(--ac-color);
+body.sticky-footer footer {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  right: 0;
 }
 
-main {
-  margin: 0 auto;
-  max-width: 1200px;
+.logo {
+  color: var(--ac-color);
 }
 
 button {
@@ -213,3 +215,7 @@ ol li {
     display: flex;
   }
 }
+
+#installPWA {
+  display: none;
+}

+ 51 - 0
assets/js/pwa.js

@@ -0,0 +1,51 @@
+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.getElementById('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';
+  });
+
+  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;
+    }
+  };
+
+});

+ 7 - 0
components/README.md

@@ -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._

+ 0 - 319
index.html

@@ -1,319 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-  <meta charset='utf-8'>
-  <meta http-equiv="X-UA-Compatible" content="IE=edge">
-  <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, shrink-to-fit=no">
-  <title>Postwoman - API request builder</title>
-  <meta name="description" content="The Postwoman API request builder helps you create your requests faster, saving you precious time on your development.">
-  <link rel="icon" href="favicon.ico">
-  <meta itemprop="name" content="Postwoman - API request builder">
-  <meta itemprop="description" content="The Postwoman API request builder helps you create your requests faster, saving you precious time on your development.">
-  <meta itemprop="image" content="icons/icon-192x192.png">
-  <!-- See https://goo.gl/OOhYW5 -->
-  <link rel="manifest" href="manifest.json">
-  <!-- See https://goo.gl/qRE0vM -->
-  <meta name="theme-color" content="#121212">
-  <!-- Add to homescreen for Chrome on Android. Fallback for manifest.json -->
-  <meta name="mobile-web-app-capable" content="yes">
-  <meta name="application-name" content="Postwoman - API request builder">
-  <!-- Add to homescreen for Safari on iOS -->
-  <meta name="apple-mobile-web-app-capable" content="yes">
-  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
-  <meta name="apple-mobile-web-app-title" content="Postwoman - API request builder">
-  <!-- Homescreen icons -->
-  <link rel="apple-touch-icon" href="icons/icon-48x48.png">
-  <link rel="apple-touch-icon" sizes="72x72" href="icons/icon-72x72.png">
-  <link rel="apple-touch-icon" sizes="96x96" href="icons/icon-96x96.png">
-  <link rel="apple-touch-icon" sizes="144x144" href="icons/icon-144x144.png">
-  <link rel="apple-touch-icon" sizes="192x192" href="icons/icon-192x192.png">
-  <!-- Tile icon for Windows 8 (144x144 + tile color) -->
-  <meta name="msapplication-TileImage" content="icons/icon-144x144.png">
-  <meta name="msapplication-TileColor" content="#121212">
-  <meta name="msapplication-tap-highlight" content="no">
-  <!-- OpenGraph -->
-  <meta property="og:site_name" content="Postwoman - API request builder">
-  <meta property="og:url" content="https://liyasthomas.github.io/postwoman">
-  <meta property="og:type" content="website">
-  <meta property="og:title" content="Postwoman - API request builder">
-  <meta property="og:description" content="API request builder">
-  <meta property="og:image" content="icons/icon-144x144.png">
-  <!-- Twitter -->
-  <meta name="twitter:card" content="summary">
-  <meta name="twitter:site" content="@liyasthomas">
-  <meta name="twitter:creator" content="@liyasthomas">
-  <meta name="twitter:url" content="https://liyasthomas.github.io/postwoman">
-  <meta name="twitter:title" content="Postwoman - API request builder">
-  <meta name="twitter:description" content="API request builder">
-  <meta name="twitter:image" content="icons/icon-144x144.png">
-  <!-- Web Fonts -->
-  <link href="https://fonts.googleapis.com/css?family=Poppins:500,700&display=swap" rel="stylesheet">
-  <link rel="stylesheet" href="style.css">
-  <script>
-    if ('serviceWorker' in navigator) {
-      window.addEventListener('load', function() {
-        navigator.serviceWorker.register('sw.js').then(function(registration) {
-          console.log('ServiceWorker registration successful with scope: ', registration.scope);
-        }).catch(function(err) {
-          console.log('ServiceWorker registration failed: ', err);
-        });
-      });
-    }
-
-  </script>
-  <script src='https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js'></script>
-</head>
-
-<body>
-  <main id="app">
-    <header>
-      <div>
-        <a href="">
-          <h1 class="logo"><img src="icons/logo.svg" alt="" style="height: 24px; margin-right: 16px">Postwoman</h1>
-        </a>
-        <h3>API request builder</h3>
-      </div>
-    </header>
-    <fieldset class="request" ref="request">
-      <legend v-on:click="collapse">Request ↕</legend>
-      <div class="collapsible">
-        <ul>
-          <li>
-            <label for="method">Method</label>
-            <select v-model="method">
-              <option>GET</option>
-              <option>POST</option>
-              <option>PUT</option>
-              <option>DELETE</option>
-              <option>OPTIONS</option>
-            </select>
-          </li>
-          <li>
-            <label for="url">URL</label>
-            <input type="url" v-bind:class="{ error: urlNotValid }" v-model="url" v-on:keyup.enter="sendRequest">
-          </li>
-          <li>
-            <label for="path">Path</label>
-            <input v-model="path" v-on:keyup.enter="sendRequest">
-          </li>
-          <li>
-            <label for="action">&nbsp;</label>
-            <button v-bind:class="{ disabled: urlNotValid }" name="action" @click="sendRequest">Send</button>
-          </li>
-        </ul>
-      </div>
-    </fieldset>
-    <fieldset class="reqbody" v-if="method === 'POST' || method === 'PUT'">
-      <legend v-on:click="collapse">Request Body ↕</legend>
-      <div class="collapsible">
-        <ul>
-          <li>
-            <label>Content Type</label>
-            <select v-model="contentType">
-              <option>application/json</option>
-              <option>www-form/urlencoded</option>
-            </select>
-          </li>
-        </ul>
-        <ol v-for="(param, index) in bodyParams">
-          <li>
-            <label :for="'bparam'+index">Key {{index + 1}}</label>
-            <input :name="'bparam'+index" v-model="param.key">
-          </li>
-          <li>
-            <label :for="'bvalue'+index">Value {{index + 1}}</label>
-            <input :name="'bvalue'+index" v-model="param.value">
-          </li>
-          <li>
-            <label for="request">&nbsp;</label>
-            <button name="request" @click="removeRequestBodyParam(index)">Remove</button>
-          </li>
-        </ol>
-        <ul>
-          <li>
-            <label for="addrequest">Action</label>
-            <button name="addrequest" @click="addRequestBodyParam">Add</button>
-          </li>
-        </ul>
-        <ul>
-          <li>
-            <label for="request">Parameter List</label>
-            <textarea name="request" rows="1" readonly>{{rawRequestBody || '(add at least one parameter)'}}</textarea>
-          </li>
-        </ul>
-      </div>
-    </fieldset>
-    <fieldset class="authentication hidden">
-      <legend v-on:click="collapse">Authentication ↕</legend>
-      <div class="collapsible">
-        <ul>
-          <li>
-            <label for="auth">Authentication Type</label>
-            <select v-model="auth">
-              <option>None</option>
-              <option>Basic</option>
-              <option>Bearer Token</option>
-            </select>
-          </li>
-        </ul>
-        <ul v-if="auth === 'Basic'">
-          <li>
-            <label for="http_basic_user">User</label>
-            <input v-model="httpUser">
-          </li>
-          <li>
-            <label for="http_basic_passwd">Password</label>
-            <input v-model="httpPassword" type="password">
-          </li>
-        </ul>
-        <ul v-if="auth === 'Bearer Token'">
-          <li>
-            <label for="bearer_token">Token</label>
-            <input v-model="bearerToken">
-          </li>
-        </ul>
-      </div>
-    </fieldset>
-    <fieldset class="parameters hidden">
-      <legend v-on:click="collapse">Parameters ↕</legend>
-      <div class="collapsible">
-        <ol v-for="(param, index) in params">
-          <li>
-            <label :for="'param'+index">Key {{index + 1}}</label>
-            <input :name="'param'+index" v-model="param.key">
-          </li>
-          <li>
-            <label :for="'value'+index">Value {{index + 1}}</label>
-            <input :name="'value'+index" v-model="param.value">
-          </li>
-          <li>
-            <label for="param">&nbsp;</label>
-            <button name="param" @click="removeRequestParam(index)">Remove</button>
-          </li>
-        </ol>
-        <ul>
-          <li>
-            <label for="add">Action</label>
-            <button name="add" @click="addRequestParam">Add</button>
-          </li>
-        </ul>
-        <ul>
-          <li>
-            <label for="request">Parameter List</label>
-            <textarea name="request" rows="1" readonly>{{queryString || '(add at least one parameter)'}}</textarea>
-          </li>
-        </ul>
-      </div>
-    </fieldset>
-    <fieldset class="response" id="response" ref="response">
-      <legend v-on:click="collapse">Response ↕</legend>
-      <div class="collapsible">
-        <ul>
-          <li>
-            <label for="status">status</label>
-            <input name="status" type="text" readonly :value="response.status || '(waiting to send request)'">
-          </li>
-        </ul>
-        <ul v-for="(value, key) in response.headers">
-          <li>
-            <label for="value">{{key}}</label>
-            <input name="value" :value="value" readonly>
-          </li>
-        </ul>
-        <ul>
-          <li>
-            <label for="body">response</label>
-            <textarea name="body" rows="10" readonly>{{response.body || '(waiting to send request)'}}</textarea>
-          </li>
-        </ul>
-      </div>
-    </fieldset>
-    <fieldset class="history">
-      <legend v-on:click="collapse">History ↕</legend>
-      <div class="collapsible">
-        <ul>
-          <li>
-            <button v-bind:class="{ disabled: noHistoryToClear }" v-on:click="clearHistory">Clear History</button>
-          </li>
-        </ul>
-        <ul v-for="entry in history">
-          <li>
-            <label for="time">Time</label>
-            <input name="time" type="text" readonly :value="entry.time">
-          </li>
-          <li>
-            <label for="name">Method</label>
-            <input name="name" type="text" readonly :value="entry.method">
-          </li>
-          <li>
-            <label for="name">URL</label>
-            <input name="name" type="text" readonly :value="entry.url">
-          </li>
-          <li>
-            <label for="name">Path</label>
-            <input name="name" type="text" readonly :value="entry.path">
-          </li>
-          <li>
-            <label for="delete">&nbsp;</label>
-            <button name="delete" @click="deleteHistory(entry)">Delete</button>
-          </li>
-          <li>
-            <label for="use">&nbsp;</label>
-            <button name="use" @click="useHistory(entry)">Use</button>
-          </li>
-        </ul>
-      </div>
-    </fieldset>
-    <footer>
-      <a href="https://github.com/liyasthomas/postwoman" target="_blank"><img src="icons/github.svg" alt="" style="margin-right: 16px">GitHub</a>
-      <button id="installPWA" onclick="installPWA()">
-        Install PWA
-      </button>
-    </footer>
-  </main>
-  <script src="script.js"></script>
-  <script>
-    let pwaInstalled = localStorage.getItem('pwaInstalled') == 'yes'
-    if (window.matchMedia('(display-mode: standalone)').matches) {
-      localStorage.setItem('pwaInstalled', 'yes')
-      pwaInstalled = true
-    }
-    if (window.navigator.standalone === true) {
-      localStorage.setItem('pwaInstalled', 'yes')
-      pwaInstalled = true
-    }
-    if (pwaInstalled) {
-      document.getElementById('installPWA').style.display = 'none'
-    } else {
-      document.getElementById('installPWA').style.display = 'block'
-    }
-    let deferredPrompt = null
-    window.addEventListener('beforeinstallprompt', (e) => {
-      deferredPrompt = e
-    })
-    async function installPWA() {
-      if (deferredPrompt) {
-        deferredPrompt.prompt()
-        deferredPrompt.userChoice.then(({
-          outcome
-        }) => {
-          if (outcome === 'accepted') {
-            console.log('Your PWA has been installed')
-          } else {
-            console.log('User chose to not install your PWA')
-          }
-          deferredPrompt = null
-        })
-      }
-    }
-    window.addEventListener('appinstalled', (evt) => {
-      localStorage.setItem('pwaInstalled', 'yes')
-      pwaInstalled = true
-      document.getElementById('installPWA').style.display = 'none'
-    })
-
-  </script>
-</body>
-
-</html>

Some files were not shown because too many files changed in this diff