Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lhc70000 committed May 24, 2024
0 parents commit 80747ae
Show file tree
Hide file tree
Showing 23 changed files with 2,217 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
indent_style = space
indent_size = 2
129 changes: 129 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Created by https://www.toptal.com/developers/gitignore/api/node,macos,vscode+all
# Edit at https://www.toptal.com/developers/gitignore?templates=node,macos,vscode+all
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
.env.production
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
### Node Patch ###
# Serverless Webpack directories
.webpack/
# Optional stylelint cache
.stylelintcache
# SvelteKit build / generate output
.svelte-kit
#!! ERROR: vscode+all is undefined. Use list command to see defined gitignore types !!#
# End of https://www.toptal.com/developers/gitignore/api/node,macos,vscode+all
.vscode/
*.js.map
*.css.map
package-lock.json

dist/

8 changes: 8 additions & 0 deletions .parcelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "@parcel/config-default",
"optimizers": {
"*.html": [
"parcel-optimizer-webview"
]
}
}
28 changes: 28 additions & 0 deletions Info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "OpenSubtitles",
"identifier": "io.iina.opensub",
"version": "1.0.0",
"description": "Description here",
"author": {
"name": "IINA Developers",
"email": "[email protected]",
"url": "https://iina.io"
},
"entry": "dist/index.js",
"global": "dist/global.js",
"permissions": ["show-osd", "file-system", "network-request"],
"allowedDomains": ["*"],
"sidebarTab": {
"name": "OpenSubtitles"
},
"subtitleProviders": [
{
"id": "open-sub",
"name": "OpenSubtitles"
}
],
"preferencesPage": "pref.html",
"preferenceDefaults": {
"languages": ""
}
}
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# IINA Plugin for opensubtitles.com

Read the [plugin documentation](https://docs.iina.io/modules.html) before starting.

## Install from IINA

Choose "Install from GitHub" and enter `iina/plugin-opensub`.
Alternatively, you can download the `iinaplgz` file from the latest release.

## Build

```bash
npm install
npm run build
```

## Load locally

```
iina-plugin link .
```
8 changes: 8 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"typeRoots": [
"./node_modules/@types",
"./node_modules/iina-plugin-definition"
]
}
}
56 changes: 56 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "iina-plugin-opensub",
"version": "0.9.0",
"description": "",
"main": "src/index.js",
"scripts": {
"serve-window": "parcel serve ui/window/index.html --dist-dir dist/ui/window",
"serve-sidebar": "parcel serve ui/sidebar/index.html --dist-dir dist/ui/sidebar",
"build": "rm -rf dist .parcel-cache && parcel build .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@parcel/transformer-sass": "^2.8.3",
"@parcel/transformer-vue": "^2.11.0",
"buffer": "^6.0.3",
"iina-plugin-definition": "^0.0.7",
"prettier": "^2.8.8",
"process": "^0.11.10"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/vue-fontawesome": "^3.0.6",
"axios": "^1.6.7",
"parcel": "^2.8.3",
"parcel-optimizer-webview": "git+https://github.com/iina/parcel-optimizer-webview.git",
"vue": "^3.3.4"
},
"browserslist": "safari >= 9",
"entry": "src/index.js",
"targets": {
"main": false,
"window": {
"distDir": "./dist/ui/window",
"source": "ui/window/index.html",
"publicUrl": "./"
},
"sidebar": {
"distDir": "./dist/ui/sidebar",
"source": "ui/sidebar/index.html",
"publicUrl": "./"
},
"global": {
"distDir": "./dist/",
"source": "src/global.js",
"isLibrary": false
},
"entry": {
"distDir": "./dist/",
"source": "src/index.js",
"isLibrary": false
}
}
}
9 changes: 9 additions & 0 deletions src/global.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { console } = iina;
console.log("Plugin is running");

function openSubLogin(username, password) {
const opensub = new OpenSubtitles();
opensub.login(username, password).then((res) => {
console.log(res);
});
}
Loading

0 comments on commit 80747ae

Please sign in to comment.