From 4571b63f1172f57a3010ee989d58d2c86e2eec3e Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 8 Nov 2018 20:26:47 -0700 Subject: [PATCH] Add components.js --- resources/assets/js/components.js | 95 +++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 resources/assets/js/components.js diff --git a/resources/assets/js/components.js b/resources/assets/js/components.js new file mode 100644 index 000000000..74a316f22 --- /dev/null +++ b/resources/assets/js/components.js @@ -0,0 +1,95 @@ +require('./components/localstorage'); +require('./components/likebutton'); +require('./components/commentform'); +require('./components/searchform'); +require('./components/bookmarkform'); +require('./components/statusform'); +require('./components/embed'); +require('./components/notifications'); + +// import Echo from "laravel-echo" + +// window.io = require('socket.io-client'); + +// window.pixelfed.bootEcho = function() { +// window.Echo = new Echo({ +// broadcaster: 'socket.io', +// host: window.location.hostname + ':2096', +// auth: { +// headers: { +// Authorization: 'Bearer ' + token.content, +// }, +// }, +// }); +// } + +Vue.component( + 'follow-suggestions', + require('./components/FollowSuggestions.vue') +); + +Vue.component( + 'discover-component', + require('./components/DiscoverComponent.vue') +); + +// Vue.component( +// 'circle-panel', +// require('./components/CirclePanel.vue') +// ); + +Vue.component( + 'post-component', + require('./components/PostComponent.vue') +); + +Vue.component( + 'post-presenter', + require('./components/PostPresenter.vue') +); + +Vue.component( + 'post-comments', + require('./components/PostComments.vue') +); + +Vue.component( + 'passport-clients', + require('./components/passport/Clients.vue') +); + +Vue.component( + 'passport-authorized-clients', + require('./components/passport/AuthorizedClients.vue') +); + +Vue.component( + 'passport-personal-access-tokens', + require('./components/passport/PersonalAccessTokens.vue') +); + +window.pixelfed.copyToClipboard = (str) => { + const el = document.createElement('textarea'); + el.value = str; + el.setAttribute('readonly', ''); + el.style.position = 'absolute'; + el.style.left = '-9999px'; + document.body.appendChild(el); + const selected = + document.getSelection().rangeCount > 0 + ? document.getSelection().getRangeAt(0) + : false; + el.select(); + document.execCommand('copy'); + document.body.removeChild(el); + if (selected) { + document.getSelection().removeAllRanges(); + document.getSelection().addRange(selected); + } +}; + +$(document).ready(function() { + $(function () { + $('[data-toggle="tooltip"]').tooltip() + }); +}); \ No newline at end of file