Permalink
Please sign in to comment.
Showing
with
352 additions
and 0 deletions.
- +4 โ0 .gitignore
- +21 โ0 LICENSE
- +22 โ0 README.md
- +101 โ0 app/css/main.css
- BIN app/img/icon.icns
- BIN app/img/loader.png
- BIN app/img/loader@2x.png
- +18 โ0 app/index.html
- +23 โ0 app/js/index.js
- +49 โ0 main.js
- BIN media/screenshot@2x.png
- +98 โ0 menu.js
- +16 โ0 package.json
| @@ -0,0 +1,4 @@ | ||
| +build | ||
| +.idea | ||
| +node_modules | ||
| +*.log |
21
LICENSE
| @@ -0,0 +1,21 @@ | ||
| +The MIT License (MIT) | ||
| + | ||
| +Copyright (c) William Bout <hello@williambout.me> (williambout.me) | ||
| + | ||
| +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. |
22
README.md
| @@ -0,0 +1,22 @@ | ||
| +# Paper for Mac | ||
| + | ||
| +> Unofficial Dropbox Paper client | ||
| + | ||
| +[](https://github.com/williambout/paper-for-mac/releases/latest) | ||
| + | ||
| +## Download | ||
| + | ||
| +[Paper for Mac](https://github.com/williambout/paper-for-mac/releases/latest) | ||
| + | ||
| +## Build | ||
| + | ||
| +- Run: `$ npm start` | ||
| +- Build: `$ npm run package` | ||
| + | ||
| +## Known Issue | ||
| + | ||
| +- External links don't work. | ||
| + | ||
| +## License | ||
| + | ||
| +MIT ยฉ [William Bout](http://williambout.me) |
101
app/css/main.css
| @@ -0,0 +1,101 @@ | ||
| +#paper { | ||
| + position: absolute; | ||
| + top: 0; | ||
| + bottom: 0; | ||
| + right: 0; | ||
| + left: 0; | ||
| + z-index: 1; | ||
| +} | ||
| + | ||
| +.drageable-area { | ||
| + position: absolute; | ||
| + top: 0; | ||
| + left: 0; | ||
| + right: 0; | ||
| + height: 20px; | ||
| + -webkit-app-region: drag; | ||
| + z-index: 10; | ||
| +} | ||
| + | ||
| +#loader { | ||
| + position: absolute; | ||
| + top: 0; | ||
| + bottom: 0; | ||
| + right: 0; | ||
| + left: 0; | ||
| + z-index: 100; | ||
| + background-color: #F7F9FA; | ||
| + opacity: 0; | ||
| + transition: opacity .2s ease; | ||
| + pointer-events: none; | ||
| + will-change: opacity; | ||
| + display: flex; | ||
| + justify-content: center; | ||
| + align-items: center; | ||
| +} | ||
| + | ||
| +.loader-container { | ||
| + display: inline-flex; | ||
| + border-radius: 50%; | ||
| + box-shadow: 0 2px 7px 0 rgba(0,0,0,0.03); | ||
| +} | ||
| + | ||
| +#loader.-active { | ||
| + opacity: 1; | ||
| + pointer-events: all; | ||
| +} | ||
| + | ||
| +#loader.-active .loader-icon { | ||
| + animation: loading 1s infinite linear; | ||
| +} | ||
| + | ||
| +@keyframes loading { | ||
| + 0% { transform: rotate(0deg) } | ||
| + 100% { transform: rotate(360deg) } | ||
| +} | ||
| + | ||
| +body, html, #app-container, .hp-app-container, #listSidebar, .hp-sidebar-container { | ||
| + background-color: transparent!important | ||
| +} | ||
| + | ||
| +.hp-page-pad-list, #padpage-container { | ||
| + background-color: white!important; | ||
| +} | ||
| + | ||
| +.hp-non-pad-page { | ||
| + padding-left: 0!important; | ||
| + margin-left: 240px; | ||
| + padding-right: 240px; | ||
| +} | ||
| + | ||
| +.hp-page { | ||
| + transition: none!important; | ||
| +} | ||
| + | ||
| +.header-pad-title-and-folder { | ||
| + left: 80px!important; | ||
| +} | ||
| + | ||
| +.hp-header-back-button { | ||
| + margin: 22px 4px 9px !important; | ||
| +} | ||
| + | ||
| +.hp-account-switcher-button { | ||
| + border-top: 1px solid rgba(0, 0, 0, 0.1)!important; | ||
| +} | ||
| + | ||
| +.hp-account-switcher-button span, .hp-sidebar-tab { | ||
| + color: rgba(0,0,0,0.4)!important; | ||
| +} | ||
| + | ||
| +.hp-account-switcher-button span, .hp-sidebar-tab.hp-sidebar-tab-active { | ||
| + color: #0070e0!important; | ||
| +} | ||
| + | ||
| +.hp-sidebar-top { | ||
| + display: none; | ||
| +} | ||
| + | ||
| +.hp-sidebar { | ||
| + padding-top: 40px; | ||
| +} |
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
| @@ -0,0 +1,18 @@ | ||
| +<!doctype html> | ||
| +<html lang="en"> | ||
| +<head> | ||
| + <meta charset="UTF-8"> | ||
| + <title>Paper</title> | ||
| + <link rel="stylesheet" href="css/main.css"> | ||
| +</head> | ||
| +<body style="-webkit-app-region: drag"> | ||
| + <div class="drageable-area"></div> | ||
| + <div id="loader"> | ||
| + <div class="loader-container"> | ||
| + <img class="loader-icon" src="./img/loader.png" srcset="./img/loader.png 95w, ./img/loader@2x.png 190w" width="95" height="95" alt=""> | ||
| + </div> | ||
| + </div> | ||
| + <webview id="paper" src="https://paper.dropbox.com/" autosize="on" preload="./js/inject.js"></webview> | ||
| + <script type="text/javascript" src="js/index.js"></script> | ||
| +</body> | ||
| +</html> |
| @@ -0,0 +1,23 @@ | ||
| +const fs = require('fs'); | ||
| +const path = require('path'); | ||
| +const {shell} = require('electron'); | ||
| + | ||
| +const webview = document.getElementById('paper'); | ||
| +const loader = document.getElementById('loader'); | ||
| + | ||
| +webview.addEventListener('dom-ready', function(){ | ||
| + webview.insertCSS(fs.readFileSync(path.join(__dirname, '/css/main.css'), 'utf8')); | ||
| +}); | ||
| + | ||
| +webview.addEventListener('new-window', (event) => { | ||
| + event.preventDefault(); | ||
| + shell.openExternal(event.url); | ||
| +}); | ||
| + | ||
| +webview.addEventListener('did-start-loading', function(){ | ||
| + loader.classList.add('-active'); | ||
| +}); | ||
| + | ||
| +webview.addEventListener('did-stop-loading', function(){ | ||
| + loader.classList.remove('-active'); | ||
| +}); |
49
main.js
| @@ -0,0 +1,49 @@ | ||
| +const {app, shell, Menu, BrowserWindow} = require('electron') | ||
| +const path = require('path') | ||
| +const url = require('url') | ||
| +const fs = require('fs') | ||
| + | ||
| +let mainWindow; | ||
| +win = null; | ||
| +const menuTemplate = require('./menu'); | ||
| + | ||
| +function createWindow () { | ||
| + | ||
| + let appMenu = Menu.buildFromTemplate(menuTemplate); | ||
| + Menu.setApplicationMenu(appMenu); | ||
| + | ||
| + win = new BrowserWindow( | ||
| + { | ||
| + width: 1024, | ||
| + height: 700, | ||
| + titleBarStyle: 'hidden', | ||
| + vibrancy: 'light', | ||
| + minWidth: 800, | ||
| + minHeight: 600, | ||
| + | ||
| + } | ||
| + ) | ||
| + | ||
| + win.loadURL('file://' + __dirname + '/app/index.html'); | ||
| + | ||
| + win.on('closed', () => { | ||
| + win = null | ||
| + }) | ||
| + | ||
| + return win; | ||
| +} | ||
| +app.on('ready', () => { | ||
| + mainWindow = createWindow(); | ||
| +}); | ||
| + | ||
| +app.on('window-all-closed', () => { | ||
| + if (process.platform !== 'darwin') { | ||
| + app.quit() | ||
| + } | ||
| +}); | ||
| + | ||
| +app.on('activate', () => { | ||
| + if (mainWindow === null) { | ||
| + createWindow() | ||
| + } | ||
| +}); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98
menu.js
| @@ -0,0 +1,98 @@ | ||
| +module.exports = [ | ||
| + { | ||
| + label: 'Paper', | ||
| + submenu: [ | ||
| + { | ||
| + label: 'About Paper', | ||
| + selector: 'orderFrontStandardAboutPanel:' | ||
| + }, | ||
| + { type: 'separator' }, | ||
| + { | ||
| + label: 'Hide Paper', | ||
| + accelerator: 'Command+H', | ||
| + selector: 'hide:' | ||
| + }, | ||
| + { | ||
| + label: 'Hide Others', | ||
| + accelerator: 'Command+Shift+H', | ||
| + selector: 'hideOtherApplications:' | ||
| + }, | ||
| + { | ||
| + label: 'Show All', | ||
| + selector: 'unhideAllApplications:' | ||
| + }, | ||
| + { type: 'separator' }, | ||
| + { | ||
| + label: 'Quit', | ||
| + accelerator: 'Command+Q', | ||
| + selector: 'terminate:' | ||
| + }, | ||
| + ] | ||
| + }, | ||
| + { | ||
| + label: 'Edit', | ||
| + submenu: [ | ||
| + { | ||
| + label: 'Undo', | ||
| + accelerator: 'Command+Z', | ||
| + selector: 'undo:' | ||
| + }, | ||
| + { | ||
| + label: 'Redo', | ||
| + accelerator: 'Shift+Command+Z', | ||
| + selector: 'redo:' | ||
| + }, | ||
| + { type: 'separator' }, | ||
| + { | ||
| + label: 'Cut', | ||
| + accelerator: 'Command+X', | ||
| + selector: 'cut:' | ||
| + }, | ||
| + { | ||
| + label: 'Copy', | ||
| + accelerator: 'Command+C', | ||
| + selector: 'copy:' | ||
| + }, | ||
| + { | ||
| + label: 'Paste', | ||
| + accelerator: 'Command+V', | ||
| + selector: 'paste:' | ||
| + }, | ||
| + { | ||
| + label: 'Select All', | ||
| + accelerator: 'Command+A', | ||
| + selector: 'selectAll:' | ||
| + } | ||
| + ] | ||
| + }, | ||
| + { | ||
| + label: 'View', | ||
| + submenu: [ | ||
| + { | ||
| + label: 'Reload', | ||
| + accelerator: 'Command+R', | ||
| + click: () => { win.reload(); } | ||
| + } | ||
| + ] | ||
| + }, | ||
| + { | ||
| + label: 'Window', | ||
| + submenu: [ | ||
| + { | ||
| + label: 'Minimize', | ||
| + accelerator: 'Command+M', | ||
| + selector: 'performMiniaturize:' | ||
| + }, | ||
| + { | ||
| + label: 'Close', | ||
| + accelerator: 'Command+W', | ||
| + selector: 'hide:' | ||
| + }, | ||
| + { type: 'separator' }, | ||
| + { | ||
| + label: 'Bring All to Front', | ||
| + selector: 'arrangeInFront:' | ||
| + } | ||
| + ] | ||
| + } | ||
| +]; |
16
package.json
| @@ -0,0 +1,16 @@ | ||
| +{ | ||
| + "name": "Paper", | ||
| + "version": "0.1.0", | ||
| + "main": "./main.js", | ||
| + "scripts": { | ||
| + "start": "electron .", | ||
| + "package": "electron-packager ./ Paper --out ./build/ --overwrite --icon=./app/img/icon.icns" | ||
| + }, | ||
| + "devDependencies": { | ||
| + "electron-packager": "^8.4.0", | ||
| + "electron-prebuilt": "^ 1.4.13" | ||
| + }, | ||
| + "dependencies": { | ||
| + "nconf": "^0.8.4" | ||
| + } | ||
| +} |
0 comments on commit
67ec24d