From 3a16a07ba48a2a7668a269be26ff2930847264fd Mon Sep 17 00:00:00 2001 From: CORBIERE Sebastien Date: Fri, 21 Jun 2024 18:32:30 -0700 Subject: [PATCH] Minor fixes --- public/404.html | 23 +++++++++++++++++++++++ src/router/index.js | 6 +++++- src/views/SegmentSelector.vue | 4 ++-- 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 public/404.html diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..70f7210 --- /dev/null +++ b/public/404.html @@ -0,0 +1,23 @@ + + + + + + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + +
+ + + + \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 3a4f773..fea2c7f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -5,11 +5,15 @@ import ViewerInterface from '../views/ViewerInterface.vue'; const routes = [ { path: '/', + redirect: { name: 'SegmentSelector' } + }, + { + path: '/YTClipPlaylist/', name: 'SegmentSelector', component: SegmentSelector, }, { - path: '/viewer/:customHeader?', + path: '/YTClipPlaylist/viewer/:customHeader?', name: 'ViewerInterface', component: ViewerInterface, props: true, diff --git a/src/views/SegmentSelector.vue b/src/views/SegmentSelector.vue index f0c4a31..cc4d241 100644 --- a/src/views/SegmentSelector.vue +++ b/src/views/SegmentSelector.vue @@ -120,7 +120,7 @@ export default { // Assuming content is JSON and needs to be processed try { const compactData = JSON.parse(content); - this.segments = this.convertFromCompactFormat(compactData); + this.segments = this.convertFromCompact(compactData); } catch (error) { console.error("Error parsing JSON:", error); // Handle error @@ -150,7 +150,7 @@ export default { const jsonData = JSON.stringify(compactSegments); const base64EncodedData = btoa(encodeURIComponent(jsonData)); // Encode the JSON string as Base64 const viewerStyle = this.selectedStyle && ('/' + this.selectedStyle) || ''; - const viewerUrl = `${window.location.origin}/viewer${viewerStyle}?data=${base64EncodedData}`; // Construct the viewer URL with the encoded data as a parameter + const viewerUrl = `${window.location.href}viewer${viewerStyle}?data=${base64EncodedData}`; // Construct the viewer URL with the encoded data as a parameter // Check if the URL exceeds 2000 characters, a common practical limit if (viewerUrl.length > 2000) {