diff --git a/.eslintignore b/.eslintignore index 2eac19d7..e6165a19 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ *.min.js built/ coverage/ +automated_screenshots/node_modules/ diff --git a/automated_screenshots/index.js b/automated_screenshots/index.js index b7c67b4b..6dbbd739 100644 --- a/automated_screenshots/index.js +++ b/automated_screenshots/index.js @@ -10,7 +10,10 @@ const config = { }; (async () => { - const files = await Filehound.create().ext("wsz").paths("skins/").find(); + const files = await Filehound.create() + .ext("wsz") + .paths("skins/") + .find(); const browser = await puppeteer.launch(); diff --git a/css/context-menu.css b/css/context-menu.css index d7b1b2ae..4d153dea 100644 --- a/css/context-menu.css +++ b/css/context-menu.css @@ -19,22 +19,23 @@ display: block; } -#winamp2-js #context-menu, #winamp2-js #context-menu ul { +#winamp2-js #context-menu, +#winamp2-js #context-menu ul { display: none; z-index: 50; /* Gross */ - background-color: #FFFFFF; + background-color: #ffffff; position: absolute; list-style: none; padding: 0; margin: 0; - border: 1px solid #A7A394; + border: 1px solid #a7a394; cursor: default; - box-shadow: 2px 2px 4px rgba(0, 0, 0, .5); + box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); } #winamp2-js #context-menu li { position: relative; - font-family: 'Tahoma'; + font-family: "Tahoma"; font-size: 11px; color: black; white-space: nowrap; @@ -52,9 +53,10 @@ cursor: default; } -#winamp2-js #context-menu li:hover, #winamp2-js #context-menu li:hover a { - background-color: #224EB7; - color: #FFFFFF; +#winamp2-js #context-menu li:hover, +#winamp2-js #context-menu li:hover a { + background-color: #224eb7; + color: #ffffff; } #winamp2-js #context-menu li.hr { @@ -62,13 +64,13 @@ } #winamp2-js #context-menu li.hr:hover { - background-color: #FFFFFF; + background-color: #ffffff; } #winamp2-js #context-menu li.hr hr { border: none; height: 1px; - background-color: #A7A394; + background-color: #a7a394; margin: 0; padding: 0; } diff --git a/css/equalizer-window.css b/css/equalizer-window.css index 8d99e0cc..2893a712 100644 --- a/css/equalizer-window.css +++ b/css/equalizer-window.css @@ -15,29 +15,29 @@ height: 6px; width: 97px; background-position: 0 0; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js #equalizer-volume::-webkit-slider-thumb { height: 7px; width: 2px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js #equalizer-volume::-moz-range-thumb { height: 7px; width: 2px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js #equalizer-volume.center::-webkit-slider-thumb { width: 5px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js #equalizer-volume.center::-moz-range-thumb { width: 5px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js #equalizer-balance { @@ -47,29 +47,29 @@ height: 6px; width: 43px; background-position: 0 0; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js #equalizer-balance::-webkit-slider-thumb { height: 7px; width: 2px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js #equalizer-balance::-moz-range-thumb { height: 7px; width: 2px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js #equalizer-balance.center::-webkit-slider-thumb { width: 5px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js #equalizer-balance.center::-moz-range-thumb { width: 5px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js .equalizer-top { @@ -84,7 +84,7 @@ width: 9px; left: 264px; top: 3px; - cursor: url('../cursors/MAINMENU.PNG'), auto; + cursor: url("../cursors/MAINMENU.PNG"), auto; } #winamp2-js #equalizer-shade { @@ -93,7 +93,7 @@ width: 9px; left: 254px; top: 3px; - cursor: url('../cursors/MAINMENU.PNG'), auto; + cursor: url("../cursors/MAINMENU.PNG"), auto; } #winamp2-js #on { @@ -227,7 +227,7 @@ height: 51px; width: 14px; margin-top: 6px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js .band .rc-slider .rc-slider-handle { @@ -235,5 +235,5 @@ height: 11px; margin: -6px 0 0 1px; position: absolute; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } diff --git a/css/main-window.css b/css/main-window.css index b149d385..8fc65815 100755 --- a/css/main-window.css +++ b/css/main-window.css @@ -3,7 +3,7 @@ position: absolute; height: 116px; width: 275px; - cursor: url('../cursors/MAINMENU.PNG'), auto; + cursor: url("../cursors/MAINMENU.PNG"), auto; /* Ask the browser to scale showing large pixels if possible */ image-rendering: -moz-crisp-edges; /* Firefox */ image-rendering: -o-crisp-edges; /* Opera */ @@ -13,15 +13,15 @@ } #winamp2-js #main-window.doubled #context-menu { - -moz-transform: scale(.5); + -moz-transform: scale(0.5); -moz-transform-origin: top left; - -webkit-transform: scale(.5); + -webkit-transform: scale(0.5); -webkit-transform-origin: top left; } #winamp2-js #main-window.loading { background-image: none; - background-color: #FFFFFF; + background-color: #ffffff; border: 2px solid #dddddd; } @@ -45,8 +45,8 @@ } #winamp2-js #loading .ellipsis-anim span:nth-child(1) { - -webkit-animation-delay: 0.0s; - animation-delay: 0.0s; + -webkit-animation-delay: 0s; + animation-delay: 0s; } #winamp2-js #loading .ellipsis-anim span:nth-child(2) { @@ -93,7 +93,7 @@ left: 0; height: 14px; width: 275px; - cursor: url('../cursors/TITLEBAR.PNG'), auto; + cursor: url("../cursors/TITLEBAR.PNG"), auto; } #winamp2-js #option, @@ -104,7 +104,7 @@ height: 9px; width: 9px; top: 3px; - cursor: url('../cursors/MAINMENU.PNG'), auto; + cursor: url("../cursors/MAINMENU.PNG"), auto; } #winamp2-js #title-bar #option { @@ -118,7 +118,7 @@ } #winamp2-js #title-bar #close { left: 264px; - cursor: url('../cursors/CLOSE.PNG'), auto; + cursor: url("../cursors/CLOSE.PNG"), auto; } #winamp2-js #clutter-bar { position: absolute; @@ -301,19 +301,19 @@ height: 13px; width: 68px; background-position: 0 0; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js #volume::-webkit-slider-thumb { top: 1px; height: 11px; width: 14px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js #volume::-moz-range-thumb { top: 1px; height: 11px; width: 14px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js #balance { @@ -323,20 +323,20 @@ height: 13px; width: 38px; background-position: 0 0; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js #balance::-webkit-slider-thumb { top: 1px; height: 11px; width: 14px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js #balance::-moz-range-thumb { top: 1px; height: 11px; width: 14px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js .windows { @@ -367,13 +367,13 @@ top: 72px; width: 248px; height: 10px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } #winamp2-js #position::-webkit-slider-thumb { height: 10px; width: 29px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; /* * Fix the strange bug in Safair/mobile-chrome * http://stackoverflow.com/questions/26727769/rendering-glitch-when-manipulating-range-input-value-via-javascript-in-webkit @@ -385,7 +385,7 @@ #winamp2-js #position::-moz-range-thumb { height: 10px; width: 29px; - cursor: url('../cursors/POSBAR.PNG'), auto; + cursor: url("../cursors/POSBAR.PNG"), auto; } /* For some reason, we can't use display: none here */ @@ -483,7 +483,7 @@ } #winamp2-js #shade-time { - cursor: url('../cursors/MAINMENU.PNG'), auto; + cursor: url("../cursors/MAINMENU.PNG"), auto; } #winamp2-js .shade .media-info, @@ -495,7 +495,7 @@ display: none; } #winamp2-js .shade #title-bar { - cursor: url('../cursors/MAINMENU.PNG'), auto; + cursor: url("../cursors/MAINMENU.PNG"), auto; } #winamp2-js .shade .actions div { @@ -509,35 +509,40 @@ top: 2px; left: 169px; } -#winamp2-js .shade .actions #play, #winamp2-js .shade .actions #play:active { +#winamp2-js .shade .actions #play, +#winamp2-js .shade .actions #play:active { background: none; height: 10px; width: 10px; top: 2px; left: 176px; } -#winamp2-js .shade .actions #pause, #winamp2-js .shade .actions #pause:active { +#winamp2-js .shade .actions #pause, +#winamp2-js .shade .actions #pause:active { background: none; height: 10px; width: 9px; top: 2px; left: 186px; } -#winamp2-js .shade .actions #stop, #winamp2-js .shade .actions #stop:active { +#winamp2-js .shade .actions #stop, +#winamp2-js .shade .actions #stop:active { background: none; height: 10px; width: 9px; top: 2px; left: 195px; } -#winamp2-js .shade .actions #next, #winamp2-js .shade .actions #next:active { +#winamp2-js .shade .actions #next, +#winamp2-js .shade .actions #next:active { background: none; height: 10px; width: 10px; top: 2px; left: 204px; } -#winamp2-js .shade #eject, #winamp2-js .shade #eject:active { +#winamp2-js .shade #eject, +#winamp2-js .shade #eject:active { height: 10px; width: 10px; top: 2px; diff --git a/css/page.css b/css/page.css index b0ff93c8..8c282089 100644 --- a/css/page.css +++ b/css/page.css @@ -1,6 +1,6 @@ /* Rules for the page layout */ body { - background-color: #224EB7; + background-color: #224eb7; font-family: arial; font-size: 15px; } diff --git a/css/winamp.css b/css/winamp.css index b43bb751..96b02f04 100644 --- a/css/winamp.css +++ b/css/winamp.css @@ -1,32 +1,32 @@ /* Rules used by all windows */ /* Range input css reset */ -#winamp2-js input[type=range] { +#winamp2-js input[type="range"] { -webkit-appearance: none; margin: 0; padding: 0; background: none; border: none; } -#winamp2-js input[type=range]::-webkit-slider-thumb { +#winamp2-js input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; border: none; border-radius: 0; background: none; } -#winamp2-js input[type=range]::-moz-range-thumb { +#winamp2-js input[type="range"]::-moz-range-thumb { border: none; border-radius: 0; background: none; } -#winamp2-js input[type=range]::-moz-range-track { +#winamp2-js input[type="range"]::-moz-range-track { border: none; background: none; } -#winamp2-js input[type=range]:focus { +#winamp2-js input[type="range"]:focus { outline: none; } -#winamp2-js input[type=range]::-moz-focus-outer { +#winamp2-js input[type="range"]::-moz-focus-outer { border: 0; } @@ -37,24 +37,24 @@ /* Animation */ @keyframes blink { 0% { - opacity: 1.0; + opacity: 1; } 50% { - opacity: 0.0; + opacity: 0; } 100% { - opacity: 1.0; + opacity: 1; } } @-webkit-keyframes blink { 0% { - opacity: 1.0; + opacity: 1; } 50% { - opacity: 0.0; + opacity: 0; } 100% { - opacity: 1.0; + opacity: 1; } } @@ -69,7 +69,7 @@ #winamp2-js .window { position: absolute; - cursor: url('../cursors/MAINMENU.PNG'), auto; + cursor: url("../cursors/MAINMENU.PNG"), auto; /* Ask the browser to scale showing large pixels if possible */ image-rendering: -moz-crisp-edges; /* Firefox */ image-rendering: -o-crisp-edges; /* Opera */ diff --git a/js/components/App.js b/js/components/App.js index 8400c6a1..e3b582ab 100644 --- a/js/components/App.js +++ b/js/components/App.js @@ -8,23 +8,27 @@ import Skin from "./Skin"; import { equalizerEnabled, playlistEnabled } from "../config"; const App = ({ winamp, loading }) => - loading - ?
- Loading - ... - -
- :
- - {/* This is not technically kosher, since - ); + return ; }; export default connect(state => ({ skinImages: state.display.skinImages }))( diff --git a/js/components/Volume.js b/js/components/Volume.js index 09c6bbc9..88c894d4 100644 --- a/js/components/Volume.js +++ b/js/components/Volume.js @@ -4,7 +4,7 @@ import { setVolume } from "../actionCreators"; import { SET_FOCUS, UNSET_FOCUS } from "../actionTypes"; -const Volume = props => +const Volume = props => ( onChange={props.setVolume} onMouseDown={props.showMarquee} onMouseUp={props.hideMarquee} - />; + /> +); const mapStateToProps = state => state.media; diff --git a/js/components/WindowManager.js b/js/components/WindowManager.js index cff5d869..af467f01 100644 --- a/js/components/WindowManager.js +++ b/js/components/WindowManager.js @@ -131,15 +131,16 @@ class WindowManager extends React.Component { const position = this.state[i]; /* eslint-disable react/jsx-no-bind */ return ( - position && -
this.handleMouseDown(i, e)} - ref={this.getRef} - style={{ ...style, ...position }} - key={i} - > - {child} -
+ position && ( +
this.handleMouseDown(i, e)} + ref={this.getRef} + style={{ ...style, ...position }} + key={i} + > + {child} +
+ ) ); /* eslint-enable react/jsx-no-bind */ })} diff --git a/js/index.js b/js/index.js index da6cd9c4..aae597d0 100644 --- a/js/index.js +++ b/js/index.js @@ -20,7 +20,9 @@ if (new Browser(window).isCompatible) { window.store = store; render( - , + + + , document.getElementById("winamp2-js") ); diff --git a/js/media.js b/js/media.js index a76c3291..82136b20 100644 --- a/js/media.js +++ b/js/media.js @@ -178,9 +178,8 @@ export default { this._source.connect(this._analyser); this._source.connect(this._preamp); - this._position = typeof position !== "undefined" - ? position - : this._position; + this._position = + typeof position !== "undefined" ? position : this._position; this._startTime = this._context.currentTime - this._position; this._source.start(0, this._position); this._playing = true; diff --git a/package.json b/package.json index 3959e302..5eebf933 100644 --- a/package.json +++ b/package.json @@ -13,18 +13,14 @@ "tdd": "jest --watch", "deploy": "ssh jordaneldredge.com HASH=$HASH sh < deploy.sh", "revert": "ssh jordaneldredge.com sh < revert.sh", - "format": "prettier --write js/**/*.js css/**/*.css webpack.config.js webpack.production.config.js" + "format": + "prettier --write js/**/*.js css/**/*.css webpack.config.js webpack.production.config.js" }, "repository": { "type": "git", "url": "git+https://github.com/captbaritone/winamp2-js.git" }, - "keywords": [ - "Winamp", - "HTML5", - "audio", - "web-auido-api" - ], + "keywords": ["Winamp", "HTML5", "audio", "web-auido-api"], "author": "Jordan Eldredge ", "license": "MIT", "bugs": { @@ -41,13 +37,12 @@ "canvas-mock": "0.0.0", "css-loader": "^0.28.4", "eslint": "3.19.0", - "eslint-config-prettier": "^1.5.0", - "eslint-plugin-prettier": "^2.1.1", + "eslint-config-prettier": "^2.3.0", + "eslint-plugin-prettier": "^2.2.0", "eslint-plugin-react": "6.10.3", "file-loader": "^0.11.0", "gzip-size-cli": "^2.0.0", "jest-cli": "^20.0.4", - "prettier": "^1.4.1", "react-test-renderer": "^15.4.2", "style-loader": "^0.16.1", "travis-weigh-in": "^1.0.2", @@ -64,6 +59,7 @@ "classnames": "^2.2.5", "eslint-plugin-import": "^2.7.0", "jszip": "^3.1.3", + "prettier": "^1.6.0", "prop-types": "^15.5.10", "rc-slider": "^8.1.5", "react": "^15.3.1", diff --git a/yarn.lock b/yarn.lock index 9cc98584..4b74c6ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1916,9 +1916,9 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-config-prettier@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-1.5.0.tgz#969b6d21b2eb2574a6810426507f755072db1963" +eslint-config-prettier@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.3.0.tgz#b75b1eabea0c8b97b34403647ee25db349b9d8a0" dependencies: get-stdin "^5.0.1" @@ -1951,9 +1951,9 @@ eslint-plugin-import@^2.7.0: minimatch "^3.0.3" read-pkg-up "^2.0.0" -eslint-plugin-prettier@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.1.1.tgz#2fb7e2ab961f2b61d2c8cf91bc17716ca8c53868" +eslint-plugin-prettier@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.2.0.tgz#f2837ad063903d73c621e7188fb3d41486434088" dependencies: fast-diff "^1.1.1" jest-docblock "^20.0.1" @@ -4295,9 +4295,9 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -prettier@^1.4.1: - version "1.4.4" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.4.4.tgz#a8d1447b14c9bf67e6d420dcadd10fb9a4fad65a" +prettier@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.6.0.tgz#23e9c68251f440feb847f558821bead21765919a" pretty-bytes@^4.0.2: version "4.0.2"