Skip to content

Commit

Permalink
feat: added "open in gogo" button
Browse files Browse the repository at this point in the history
  • Loading branch information
Jabster28 committed Jul 13, 2020
1 parent 22ac754 commit 8d53534
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion quasar.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ module.exports = configure(function(ctx) {
importStrategy: 'auto',

// Quasar plugins
plugins: ['Loading', 'LocalStorage', 'Notify']
plugins: ['Loading', 'LocalStorage', 'Notify', 'Dialog']
},

animations: 'all', // --- includes all animations
Expand Down
40 changes: 40 additions & 0 deletions src/pages/Anime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@
class="q-ma-lg"
:data-plyr-embed-id="anime.trailer_url"
></div>
<q-btn
class="q-ma-lg"
color="deep-orange"
clickable
@click="checkNotif"
type="a"
target="_blank"
:href="
`https://www25.gogoanimes.tv//search.html?keyword=${encodeURIComponent(
anime.title
)}`
"
>
Watch on gogo</q-btn
>
<q-btn
class="q-ma-lg"
color="primary"
Expand Down Expand Up @@ -95,6 +110,31 @@ export default Vue.extend({
$route: 'fetchData'
},
methods: {
checkNotif(e: Event) {
let cache = this.$q.localStorage.getItem('cache');
// @ts-ignore
if (e.ctrlKey || cache.gogo) {
} else {
e.preventDefault();
this.$q
.dialog({
title: 'Hold up!',
message:
'This streaming service has a lot of potentially mature ads and pop-ups, so I\'d suggest you get <a target="_blank" href="https://github.com/gorhill/uBlock/tree/README.md">a good adblocker</a> before proceeding.',
cancel: true,
html: true,
persistent: true
})
.onOk(() => {
// @ts-ignore
cache.gogo = true;
this.$q.localStorage.set('cache', cache);
window.location.href = `https://www25.gogoanimes.tv//search.html?keyword=${encodeURIComponent(
this.anime.title
)}`;
});
}
},
norm(x: number) {
if (!x) return;
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
Expand Down

1 comment on commit 8d53534

@vercel
Copy link

@vercel vercel bot commented on 8d53534 Jul 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.