mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-25 19:13:54 +00:00
Begin introducing es6
This commit is contained in:
parent
3a2a8f3941
commit
b5c7824f86
4 changed files with 48 additions and 40 deletions
|
|
@ -1,8 +1,15 @@
|
|||
{
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6
|
||||
},
|
||||
"ecmaFeatures": {
|
||||
"modules": true
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"amd": true
|
||||
"amd": true,
|
||||
"es6": true
|
||||
},
|
||||
|
||||
"rules": {
|
||||
|
|
|
|||
68
js/main.js
68
js/main.js
|
|
@ -1,41 +1,31 @@
|
|||
define([
|
||||
'browser',
|
||||
'main-window-dom',
|
||||
'../css/winamp.css',
|
||||
'../css/main-window.css',
|
||||
'../css/context-menu.css',
|
||||
'winamp',
|
||||
'context',
|
||||
'hotkeys'
|
||||
], function(
|
||||
Browser,
|
||||
mainWindowDom,
|
||||
winampCss,
|
||||
mainWindowCss,
|
||||
contextMenuCss,
|
||||
Winamp,
|
||||
Context,
|
||||
Hotkeys
|
||||
) {
|
||||
if (new Browser(window).isCompatible) {
|
||||
var mainWindowElement = document.createElement('div');
|
||||
mainWindowElement.appendChild(mainWindowDom);
|
||||
document.getElementById('winamp2-js').appendChild(mainWindowElement);
|
||||
import Browser from './browser';
|
||||
import mainWindowDom from './main-window-dom';
|
||||
import Winamp from './winamp';
|
||||
import Context from './context';
|
||||
import Hotkeys from './hotkeys';
|
||||
|
||||
var winamp = Winamp.init({
|
||||
volume: 50,
|
||||
balance: 0,
|
||||
mediaFile: {
|
||||
url: 'https://cdn.rawgit.com/captbaritone/llama/master/llama-2.91.mp3',
|
||||
name: "1. DJ Mike Llama - Llama Whippin' Intro"
|
||||
},
|
||||
skinUrl: 'https://cdn.rawgit.com/captbaritone/winamp-skins/master/v2/base-2.91.wsz'
|
||||
});
|
||||
import '../css/winamp.css';
|
||||
import '../css/main-window.css';
|
||||
import '../css/context-menu.css';
|
||||
|
||||
new Hotkeys(winamp);
|
||||
new Context(winamp);
|
||||
} else {
|
||||
document.getElementById('winamp').style.display = 'none';
|
||||
document.getElementById('browser-compatibility').style.display = 'block';
|
||||
}
|
||||
});
|
||||
if (new Browser(window).isCompatible) {
|
||||
var mainWindowElement = document.createElement('div');
|
||||
mainWindowElement.appendChild(mainWindowDom);
|
||||
document.getElementById('winamp2-js').appendChild(mainWindowElement);
|
||||
|
||||
var winamp = Winamp.init({
|
||||
volume: 50,
|
||||
balance: 0,
|
||||
mediaFile: {
|
||||
url: 'https://cdn.rawgit.com/captbaritone/llama/master/llama-2.91.mp3',
|
||||
name: "1. DJ Mike Llama - Llama Whippin' Intro"
|
||||
},
|
||||
skinUrl: 'https://cdn.rawgit.com/captbaritone/winamp-skins/master/v2/base-2.91.wsz'
|
||||
});
|
||||
|
||||
new Hotkeys(winamp);
|
||||
new Context(winamp);
|
||||
} else {
|
||||
document.getElementById('winamp').style.display = 'none';
|
||||
document.getElementById('browser-compatibility').style.display = 'block';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@
|
|||
},
|
||||
"homepage": "https://github.com/captbaritone/winamp2-js#readme",
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.10.4",
|
||||
"babel-loader": "^6.2.4",
|
||||
"babel-preset-es2015": "^6.9.0",
|
||||
"css-loader": "^0.23.1",
|
||||
"eslint": "1.*",
|
||||
"style-loader": "^0.13.1",
|
||||
|
|
|
|||
|
|
@ -9,6 +9,14 @@ module.exports = {
|
|||
{
|
||||
test: /\.css$/,
|
||||
loader: 'style-loader!css-loader'
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
loader: 'babel', // 'babel-loader' is also a legal name to reference
|
||||
query: {
|
||||
presets: ['es2015']
|
||||
}
|
||||
}
|
||||
],
|
||||
noParse: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue