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
<template> | |
<form class="q-pa-lg"> | |
<q-input v-model="blogTitle" class="q-ma-lg" filled label="Title" /> | |
<q-card flat bordered class="q-ma-lg"> | |
<q-editor | |
min-height="5rem" | |
:placeholder="storyPlaceholder" | |
v-model="blogContent" | |
/> | |
</q-card> |
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
<template> | |
<q-layout view="lHh Lpr fff" class="bg-grey-1"> | |
<q-header elevated class="bg-white text-grey-8" height-hint="64"> | |
<q-toolbar class="GNL__toolbar"> | |
<q-btn | |
flat | |
dense | |
round | |
@click="toggleLeftDrawer" | |
aria-label="Menu" |
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
/* dependancies*/ | |
const express = require("express"); | |
const cors = require("cors"); | |
const { initializeApp, cert } = require("firebase-admin/app"); | |
const { | |
getFirestore, | |
Timestamp, | |
FieldValue, | |
} = require("firebase-admin/firestore"); | |
const busboy = require("busboy"); |
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
<template> | |
<q-footer elevated reveal class="bg-grey-8" bordered> | |
<div class="constrain"> | |
<q-banner | |
inline-actions | |
dense | |
class="bg-grey-8 text-white" | |
v-if="showInsatllbanner" | |
> | |
<b>Install Blogify? </b> |
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
//Cache first, falling back to network | |
registerRoute( | |
({ url }) => url.host.startsWith("fonts.googleapi.com"), | |
new CacheFirst({ | |
cacheName: "google-fonts", | |
plugins: [ | |
new ExpirationPlugin({ | |
maxEntries: 30, | |
}), | |
new CacheableResponsePlugin({ |
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
import { Queue } from "workbox-background-sync"; | |
let backgroundSync = "sync" in self.registration ? true : false; | |
/* | |
queue- create post | |
*/ | |
let createBlogQueue = null; | |
if (backgroundSync) { | |
createBlogQueue = new Queue("createBlogQueue", { |
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
if (!navigator.onLine && isBackgroundSyncSupported.value) { | |
// Notify user about successful blog creation | |
$q.notify({ | |
message: "Offline Blog Created Successfully!", | |
type: "positive", | |
timeout: 2000, | |
}); | |
// Redirect to the home page | |
router.push("/"); |
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
<template> | |
//rest of the code | |
<q-card | |
class="my-card q-ma-lg" | |
:class="{ 'bg-red-1': blog.offline }" | |
flat | |
bordered | |
v-for="blog in blogList" | |
:key="blog.key" | |
@click="redirectToBlog(blog.id)" |
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
<script setup> | |
//imports | |
import { useRouter } from "vue-router"; | |
import { onMounted, ref } from "vue"; | |
import { useQuasar } from "quasar"; | |
//variables | |
const router = useRouter(); | |
const showInsatllbanner = ref(false); | |
const leftDrawerOpen = ref(false); |
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
let webpush = require("web-push"); | |
const publicKey = | |
"Your-public-key"; | |
const privateKey = "Your-private-key"; | |
/* | |
config - webpush |
OlderNewer