mirror of
https://github.com/pinry/pinry.git
synced 2025-11-16 18:05:51 +01:00
Feature: Add bookmarklet link generation in PHeader
This commit is contained in:
committed by
Isaac Bythewood
parent
2c92cf45b7
commit
55d7d61b17
@@ -17,7 +17,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="PinryNav" class="navbar-menu" :class="{ 'is-active': active}">
|
<div id="PinryNav" class="navbar-menu" :class="{ 'is-active': active}">
|
||||||
<div class="navbar-start">
|
<div class="navbar-start">
|
||||||
<a class="navbar-item">
|
<a class="navbar-item" :href="bookmarkLet">
|
||||||
BookmarkLet
|
BookmarkLet
|
||||||
</a>
|
</a>
|
||||||
<div
|
<div
|
||||||
@@ -117,6 +117,13 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
bookmarkLet() {
|
||||||
|
const url = new URL(window.location);
|
||||||
|
const host = url.origin;
|
||||||
|
return `javascript:void((function(d){var s=d.createElement('script');s.id='pinry-bookmarklet';s.src='${host}/static/js/bookmarklet.js?'+Math.random()*10000000000000000;d.body.appendChild(s)})(document));`;
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleMenu() {
|
toggleMenu() {
|
||||||
this.active = !this.active;
|
this.active = !this.active;
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ module.exports = {
|
|||||||
target: 'http://localhost:8000/',
|
target: 'http://localhost:8000/',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
|
'/static/js/': {
|
||||||
|
target: 'http://localhost:8000/',
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user