From a1d69dbba7072991dae16964ad61bc70128d982a Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 2 Jan 2016 16:01:08 +0100 Subject: [PATCH] initial commit --- .gitignore | 2 ++ LICENSE | 20 ++++++++++++++++++++ README.md | 29 +++++++++++++++++++++++++++++ index.css | 27 +++++++++++++++++++++++++++ index.html | 17 +++++++++++++++++ index.js | 45 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 44 ++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 184 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 index.css create mode 100644 index.html create mode 100644 index.js create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..bd07d4e1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +/dist diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..c7e68527 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 00000000..5cd51aa7 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# WebTorrent.app + +### Streaming torrent client, for the desktop + +## Dev + +``` +$ npm install +``` + +### Run + +``` +$ npm start +``` + +### Build + +``` +$ npm run build +``` + +Builds the app for OS X, Linux, and Windows, using [electron-packager](https://github.com/maxogden/electron-packager). + + +## License + +MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org). + diff --git a/index.css b/index.css new file mode 100644 index 00000000..78bb8059 --- /dev/null +++ b/index.css @@ -0,0 +1,27 @@ +html, +body { + padding: 0; + margin: 0; +} + +body { + font-family: -apple-system, 'Helvetica Neue', Helvetica, sans-serif; +} + +header { + position: absolute; + width: 500px; + height: 250px; + top: 50%; + left: 50%; + margin-top: -125px; + margin-left: -250px; + text-align: center; +} + +header h1 { + font-size: 60px; + font-weight: 100; + margin: 0; + padding: 0; +} diff --git a/index.html b/index.html new file mode 100644 index 00000000..d5c6efbf --- /dev/null +++ b/index.html @@ -0,0 +1,17 @@ + + + + + Electron boilerplate + + + +
+
+

Electron boilerplate

+
+
+ +
+ + diff --git a/index.js b/index.js new file mode 100644 index 00000000..1c275ef6 --- /dev/null +++ b/index.js @@ -0,0 +1,45 @@ +var electron = require('electron') +var app = electron.app + +// report crashes to the Electron project +require('crash-reporter').start() + +// adds debug features like hotkeys for triggering dev tools and reload +require('electron-debug')() + +// prevent window being garbage collected +var mainWindow + +function onClosed () { + // dereference the window + // for multiple windows store them in an array + mainWindow = null +} + +function createMainWindow () { + const win = new electron.BrowserWindow({ + width: 600, + height: 400 + }) + + win.loadURL('file://' + __dirname + '/index.html') + win.on('closed', onClosed) + + return win +} + +app.on('window-all-closed', () => { + if (process.platform !== 'darwin') { + app.quit() + } +}) + +app.on('activate', () => { + if (!mainWindow) { + mainWindow = createMainWindow() + } +}) + +app.on('ready', () => { + mainWindow = createMainWindow() +}) diff --git a/package.json b/package.json new file mode 100644 index 00000000..ae7830e7 --- /dev/null +++ b/package.json @@ -0,0 +1,44 @@ +{ + "name": "webtorrent-app", + "description": "Streaming torrent client, for the desktop", + "version": "0.0.0", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/webtorrent-app/issues" + }, + "dependencies": { + "electron-debug": "^0.5.0" + }, + "devDependencies": { + "electron-packager": "^5.0.0", + "electron-prebuilt": "^0.36.0", + "standard": "^5.4.1" + }, + "electronVersion": "0.36.0", + "files": [ + "index.js", + "index.html", + "index.css" + ], + "homepage": "https://webtorrent.io", + "keywords": [ + "electron", + "electron-app" + ], + "license": "MIT", + "main": "index.js", + "productName": "WebTorrent", + "repository": { + "type": "git", + "url": "git://github.com/feross/webtorrent-app.git" + }, + "scripts": { + "build": "electron-packager . $npm_package_productName --out=dist --ignore='^/dist$' --prune --asar --all --version=$npm_package_electronVersion", + "start": "electron .", + "test": "standard" + } +}