From 04ecff23ad523733e2b260381efc83aefef265d2 Mon Sep 17 00:00:00 2001 From: Stefan Cruz <17972991+stefancruz@users.noreply.github.com> Date: Thu, 29 Aug 2024 02:00:10 +0100 Subject: [PATCH] chore(wip): prepare handover --- .github/workflows/main.yml | 56 ------------------- .prettierrc | 12 ----- DailymotionConfig.json | 17 +++--- Readme.md | 4 +- assets/index.html | 101 ----------------------------------- build/DailymotionConfig.json | 17 +++--- build/index.html | 101 ----------------------------------- rollup.config.js | 3 +- 8 files changed, 17 insertions(+), 294 deletions(-) delete mode 100644 .github/workflows/main.yml delete mode 100644 .prettierrc delete mode 100644 assets/index.html delete mode 100644 build/index.html diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 1248ab6..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Build Typescript - -on: - push: - branches: ["master"] - workflow_dispatch: - -permissions: - contents: write - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: true - -jobs: - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - persist-credentials: false # Ensure the token is used for pushing - fetch-depth: 0 # Fetch all history for all branches and tags - - # - name: Set up Node.js - # uses: actions/setup-node@v3 - # with: - # node-version: '20' - - # - name: Install dependencies - # run: npm install - - # - name: Build the project - # run: npm run build - - # - name: Sign the plugin - # run: sh sign.sh ./build/DailymotionScript.js ./build/DailymotionConfig.json - # env: - # SIGNING_PRIVATE_KEY: ${{ secrets.SIGNING_PRIVATE_KEY }} - - - name: Setup Pages - uses: actions/configure-pages@v5 - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: 'build' - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 9a2e55f..0000000 --- a/.prettierrc +++ /dev/null @@ -1,12 +0,0 @@ -trailingComma: "all" -arrowParens: "always" -printWidth: 80 -tabWidth: 2 -useTabs: false -singleQuote: true -semi: true -rangeStart: 0 -parser: "typescript" -htmlWhitespaceSensitivity: "css" -embeddedLanguageFormatting: "auto" -endOfLine: "lf" diff --git a/DailymotionConfig.json b/DailymotionConfig.json index c47dffe..4be7d0c 100644 --- a/DailymotionConfig.json +++ b/DailymotionConfig.json @@ -1,12 +1,12 @@ { "name": "Dailymotion (Beta)", - "platformUrl": "dailymotion.com", + "platformUrl": "https://dailymotion.com", "description": "The latest news, sports, music and entertainment videos on Dailymotion", - "author": "Stefan Cruz", - "authorUrl": "", - "sourceUrl": "https://stefancruz.github.io/GrayjayDailymotion/DailymotionConfig.json", + "author": "Futo", + "authorUrl": "https://futo.org", + "sourceUrl": "https://plugins.grayjay.app/Dailymotion/DailymotionConfig.json", "scriptUrl": "./DailymotionScript.js", - "repositoryUrl": "https://github.com/stefancruz/GrayjayDailymotion", + "repositoryUrl": "https://gitlab.futo.org/videostreaming/plugins/dailymotion", "version": 20, "iconUrl": "./DailymotionIcon.png", "id": "9c87e8db-e75d-48f4-afe5-2d203d4b95c5", @@ -20,13 +20,10 @@ "allowAllHttpHeaderAccess": false, "allowUrls": [ "dailymotion.com", - "www.dailymotion.com", + "*.dailymotion.com", "graphql.api.dailymotion.com", "vod.cf.dmcdn.net", - "s1.dmcdn.net", - "s2.dmcdn.net", - "static1.dmcdn.net", - "static2.dmcdn.net", + "*.dmcdn.net", "api-2-0.spot.im" ], "authentication": { diff --git a/Readme.md b/Readme.md index c5665e7..94797ca 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ -# Dailymotion plugin for Grayjay - work in progress +# Dailymotion plugin for Grayjay -Click [here](https://stefancruz.github.io/GrayjayDailymotion/index.html) to install into Grayjay +Click [here](https://plugins.grayjay.app/) to install into Grayjay ## Features - [x] - Home diff --git a/assets/index.html b/assets/index.html deleted file mode 100644 index cbc4e20..0000000 --- a/assets/index.html +++ /dev/null @@ -1,101 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> - -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>Install Plugin</title> - <style> - body { - font-family: Arial, sans-serif; - margin: 0; - padding: 0; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - height: 100vh; - background-color: #f5f5f5; - } - - p { - margin: 20px; - text-align: center; - font-size: 1.2em; - color: #333; - } - - img { - max-width: 100%; - height: auto; - margin: 20px; - } - - @media (min-width: 600px) { - p { - font-size: 1.5em; - } - } - </style> - <script src="https://unpkg.com/qrcode-generator@1.4.4/qrcode.js"></script> - <script> - window.onload = function () { - - const hostname = window.location.hostname; - - if (hostname !== 'localhost' && hostname !== '127.0.0.1') { - const configUrl = new URL('DailymotionConfig.json', window.location.href).href; - - let qr = qrcode(0, 'L'); - qr.addData(configUrl); - qr.make(); - - let qrImgTag = qr.createImgTag(6, 8, "qr code of " + configUrl); - - let tempDiv = document.createElement('div'); - tempDiv.innerHTML = qrImgTag; - - let qrImg = tempDiv.querySelector('img'); - const title = 'QR code of the plugin configuration'; - qrImg.alt = title; - qrImg.title = title; - - let qrCodeContainer = document.getElementById('qrCodeContainer'); - if (qrCodeContainer) { - qrCodeContainer.appendChild(qrImg); - } else { - console.error('QR code container not found'); - } - - document.getElementById('qr-code-text').style.display = 'inline'; - - const isSupported = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); - - if (isSupported) { - setTimeout(function () { - window.location.href = `grayjay://plugin/${configUrl}`; - }, 1000); // Redirect after 1 seconds to allow the QR code to be seen - } else { - console.log("Currently this link is supported on mobile devices only. Use the QR code to install it on Grayjay."); - } - } else { - console.log("QR code is disabled on localhost."); - document.getElementById('qr-code-error-text').style.display = 'inline'; - } - } - </script> -</head> - -<body> - <p> - <span>Currently this link is supported on mobile devices only.</span> - <span id="qr-code-text" style="display: none;">Use the QR code to install the plugin on Grayjay.</span> - <span id="qr-code-error-text" style="display: none;">QR code is disabled on localhost.</span> - </p> - <div id="qrCodeContainer" class="qr-container"></div> - <p> - <a href="./DailymotionConfig.json">Plugin Configuration</a> - </p> -</body> - -</html> \ No newline at end of file diff --git a/build/DailymotionConfig.json b/build/DailymotionConfig.json index c47dffe..4be7d0c 100644 --- a/build/DailymotionConfig.json +++ b/build/DailymotionConfig.json @@ -1,12 +1,12 @@ { "name": "Dailymotion (Beta)", - "platformUrl": "dailymotion.com", + "platformUrl": "https://dailymotion.com", "description": "The latest news, sports, music and entertainment videos on Dailymotion", - "author": "Stefan Cruz", - "authorUrl": "", - "sourceUrl": "https://stefancruz.github.io/GrayjayDailymotion/DailymotionConfig.json", + "author": "Futo", + "authorUrl": "https://futo.org", + "sourceUrl": "https://plugins.grayjay.app/Dailymotion/DailymotionConfig.json", "scriptUrl": "./DailymotionScript.js", - "repositoryUrl": "https://github.com/stefancruz/GrayjayDailymotion", + "repositoryUrl": "https://gitlab.futo.org/videostreaming/plugins/dailymotion", "version": 20, "iconUrl": "./DailymotionIcon.png", "id": "9c87e8db-e75d-48f4-afe5-2d203d4b95c5", @@ -20,13 +20,10 @@ "allowAllHttpHeaderAccess": false, "allowUrls": [ "dailymotion.com", - "www.dailymotion.com", + "*.dailymotion.com", "graphql.api.dailymotion.com", "vod.cf.dmcdn.net", - "s1.dmcdn.net", - "s2.dmcdn.net", - "static1.dmcdn.net", - "static2.dmcdn.net", + "*.dmcdn.net", "api-2-0.spot.im" ], "authentication": { diff --git a/build/index.html b/build/index.html deleted file mode 100644 index cbc4e20..0000000 --- a/build/index.html +++ /dev/null @@ -1,101 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> - -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>Install Plugin</title> - <style> - body { - font-family: Arial, sans-serif; - margin: 0; - padding: 0; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - height: 100vh; - background-color: #f5f5f5; - } - - p { - margin: 20px; - text-align: center; - font-size: 1.2em; - color: #333; - } - - img { - max-width: 100%; - height: auto; - margin: 20px; - } - - @media (min-width: 600px) { - p { - font-size: 1.5em; - } - } - </style> - <script src="https://unpkg.com/qrcode-generator@1.4.4/qrcode.js"></script> - <script> - window.onload = function () { - - const hostname = window.location.hostname; - - if (hostname !== 'localhost' && hostname !== '127.0.0.1') { - const configUrl = new URL('DailymotionConfig.json', window.location.href).href; - - let qr = qrcode(0, 'L'); - qr.addData(configUrl); - qr.make(); - - let qrImgTag = qr.createImgTag(6, 8, "qr code of " + configUrl); - - let tempDiv = document.createElement('div'); - tempDiv.innerHTML = qrImgTag; - - let qrImg = tempDiv.querySelector('img'); - const title = 'QR code of the plugin configuration'; - qrImg.alt = title; - qrImg.title = title; - - let qrCodeContainer = document.getElementById('qrCodeContainer'); - if (qrCodeContainer) { - qrCodeContainer.appendChild(qrImg); - } else { - console.error('QR code container not found'); - } - - document.getElementById('qr-code-text').style.display = 'inline'; - - const isSupported = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); - - if (isSupported) { - setTimeout(function () { - window.location.href = `grayjay://plugin/${configUrl}`; - }, 1000); // Redirect after 1 seconds to allow the QR code to be seen - } else { - console.log("Currently this link is supported on mobile devices only. Use the QR code to install it on Grayjay."); - } - } else { - console.log("QR code is disabled on localhost."); - document.getElementById('qr-code-error-text').style.display = 'inline'; - } - } - </script> -</head> - -<body> - <p> - <span>Currently this link is supported on mobile devices only.</span> - <span id="qr-code-text" style="display: none;">Use the QR code to install the plugin on Grayjay.</span> - <span id="qr-code-error-text" style="display: none;">QR code is disabled on localhost.</span> - </p> - <div id="qrCodeContainer" class="qr-container"></div> - <p> - <a href="./DailymotionConfig.json">Plugin Configuration</a> - </p> -</body> - -</html> \ No newline at end of file diff --git a/rollup.config.js b/rollup.config.js index f8e67b4..f3f82a7 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -21,8 +21,7 @@ module.exports = { copy({ targets: [ { src: 'DailymotionConfig.json', dest }, - { src: 'assets/DailymotionIcon.png', dest }, - { src: 'assets/index.html', dest } + { src: 'assets/DailymotionIcon.png', dest } ] }) ] -- GitLab