Commit 460d03b7 authored by haseeb's avatar haseeb

changes to url posiion

parent bf619dc6
...@@ -4,19 +4,20 @@ export default () => { ...@@ -4,19 +4,20 @@ export default () => {
const embedBtn = document.querySelector('#embed-btn'); const embedBtn = document.querySelector('#embed-btn');
const snippetUrlArea = document.querySelector('#snippet-url-area'); const snippetUrlArea = document.querySelector('#snippet-url-area');
const embedAction = document.querySelector('#embed-action'); const embedAction = document.querySelector('#embed-action');
const url = `${protocol}//${host + pathname}`;
shareBtn.addEventListener('click', () => { shareBtn.addEventListener('click', () => {
shareBtn.classList.add('is-active'); shareBtn.classList.add('is-active');
embedBtn.classList.remove('is-active'); embedBtn.classList.remove('is-active');
snippetUrlArea.value = `${protocol}//${host + pathname}`; snippetUrlArea.value = url;
embedAction.innerHTML = 'Share'; embedAction.innerText = 'Share';
}); });
embedBtn.addEventListener('click', () => { embedBtn.addEventListener('click', () => {
embedBtn.classList.add('is-active'); embedBtn.classList.add('is-active');
shareBtn.classList.remove('is-active'); shareBtn.classList.remove('is-active');
const scriptTag = `<script src="${protocol}//${host + pathname}.js"></script>`; const scriptTag = `<script src="${url}.js"></script>`;
snippetUrlArea.value = scriptTag; snippetUrlArea.value = scriptTag;
embedAction.innerHTML = 'Embed'; embedAction.innerText = 'Embed';
}); });
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment