mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-20 16:49:52 +00:00
fix avaliable into available
This commit is contained in:
parent
9b8c012aa6
commit
2e360020ef
8 changed files with 22 additions and 22 deletions
|
|
@ -34,7 +34,7 @@ Create a DOM element somewhere in your HTML document. This will eventually conta
|
|||
```JavaScript
|
||||
import Winamp from 'winamp2-js';
|
||||
|
||||
// Or, if you installed via a script tag, `Winamp` is avaliable on the global `window`:
|
||||
// Or, if you installed via a script tag, `Winamp` is available on the global `window`:
|
||||
// const Winamp = window.winamp2js;
|
||||
|
||||
// Check if Winamp is supported in this browser
|
||||
|
|
@ -124,7 +124,7 @@ const options = {
|
|||
// Optional. An array of objects representing skins.
|
||||
// These will appear in the "Options" menu under "Skins".
|
||||
// Note: These URLs must be served the with correct CORs headers.
|
||||
avaliableSkins: [
|
||||
availableSkins: [
|
||||
{ url: "./green.wsz", name: "Green Dimension V2" },
|
||||
{ url: "./osx.wsz", name: "Mac OSX v1.5 (Aqua)" }
|
||||
],
|
||||
|
|
@ -144,7 +144,7 @@ const options = {
|
|||
url: './rick_roll.mp3'
|
||||
}]),
|
||||
// A boolean indicating if this options should be made
|
||||
// avaliable when the user is offline.
|
||||
// available when the user is offline.
|
||||
requiresNetwork: true
|
||||
}]
|
||||
};
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ export const REMOVE_ALL_TRACKS = "REMOVE_ALL_TRACKS";
|
|||
export const CROP_TRACKS = "CROP_TRACKS";
|
||||
export const FILE_INFO = "FILE_INFO";
|
||||
export const REMOVE_TRACKS = "REMOVE_TRACKS";
|
||||
export const SET_AVALIABLE_SKINS = "SET_AVALIABLE_SKINS";
|
||||
export const SET_AVAILABLE_SKINS = "SET_AVAILABLE_SKINS";
|
||||
export const REVERSE_LIST = "REVERSE_LIST";
|
||||
export const RANDOMIZE_LIST = "RANDOMIZE_LIST";
|
||||
export const SET_TRACK_ORDER = "SET_TRACK_ORDER";
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@ const MainContextMenu = props => (
|
|||
</Parent>
|
||||
<Parent label="Skins">
|
||||
<Node onClick={props.openSkinFileDialog} label="Load Skin..." />
|
||||
{!!props.avaliableSkins.length && <Hr />}
|
||||
{props.avaliableSkins.map(skin => (
|
||||
{!!props.availableSkins.length && <Hr />}
|
||||
{props.availableSkins.map(skin => (
|
||||
<Node
|
||||
key={skin.url}
|
||||
onClick={() => props.setSkin(skin.url)}
|
||||
|
|
@ -59,7 +59,7 @@ const MainContextMenu = props => (
|
|||
);
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
avaliableSkins: state.settings.avaliableSkins,
|
||||
availableSkins: state.settings.availableSkins,
|
||||
networkConnected: state.network.connected
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ Raven.context(() => {
|
|||
url: skinUrl
|
||||
},
|
||||
initialTracks,
|
||||
avaliableSkins: [
|
||||
availableSkins: [
|
||||
{ url: base, name: "<Base Skin>" },
|
||||
{ url: green, name: "Green Dimension V2" },
|
||||
{ url: osx, name: "Mac OSX v1.5 (Aqua)" },
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export default class LoadQueue {
|
|||
// For example, we might add a track to the playlist and then scroll to/away
|
||||
// from it before it gets processed.
|
||||
this._queue = new TinyQueue([], (a, b) => a.priority() - b.priority());
|
||||
this._avaliableThreads = threads;
|
||||
this._availableThreads = threads;
|
||||
}
|
||||
|
||||
push(task, priority) {
|
||||
|
|
@ -32,11 +32,11 @@ export default class LoadQueue {
|
|||
}
|
||||
|
||||
_run() {
|
||||
while (this._avaliableThreads > 0) {
|
||||
while (this._availableThreads > 0) {
|
||||
if (this._queue.length === 0) {
|
||||
return;
|
||||
}
|
||||
this._avaliableThreads--;
|
||||
this._availableThreads--;
|
||||
const t = this._queue.pop();
|
||||
const promise = t.task();
|
||||
invariant(
|
||||
|
|
@ -44,7 +44,7 @@ export default class LoadQueue {
|
|||
`LoadQueue only supports loading Promises. Got ${promise}`
|
||||
);
|
||||
promise.then(() => {
|
||||
this._avaliableThreads++;
|
||||
this._availableThreads++;
|
||||
this._run();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import {
|
|||
UNSET_USER_MESSAGE,
|
||||
SET_PLAYLIST_SCROLL_POSITION,
|
||||
PLAYLIST_SIZE_CHANGED,
|
||||
SET_AVALIABLE_SKINS,
|
||||
SET_AVAILABLE_SKINS,
|
||||
ADD_TRACK_FROM_URL,
|
||||
NETWORK_CONNECTED,
|
||||
NETWORK_DISCONNECTED
|
||||
|
|
@ -135,13 +135,13 @@ const display = (state = defaultDisplayState, action) => {
|
|||
};
|
||||
|
||||
const defaultSettingsState = {
|
||||
avaliableSkins: []
|
||||
availableSkins: []
|
||||
};
|
||||
|
||||
const settings = (state = defaultSettingsState, action) => {
|
||||
switch (action.type) {
|
||||
case SET_AVALIABLE_SKINS:
|
||||
return { ...state, avaliableSkins: action.skins };
|
||||
case SET_AVAILABLE_SKINS:
|
||||
return { ...state, availableSkins: action.skins };
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ const _genImgFromBlob = async blob =>
|
|||
const genImgFromBlob = async blob => {
|
||||
if (window.createImageBitmap) {
|
||||
try {
|
||||
// Use this faster native browser API if avaliable.
|
||||
// Use this faster native browser API if available.
|
||||
return await window.createImageBitmap(blob);
|
||||
} catch (e) {
|
||||
console.warn(
|
||||
|
|
|
|||
10
js/winamp.js
10
js/winamp.js
|
|
@ -11,7 +11,7 @@ import { setSkinFromUrl, loadMediaFiles } from "./actionCreators";
|
|||
import { LOAD_STYLE } from "./constants";
|
||||
|
||||
import {
|
||||
SET_AVALIABLE_SKINS,
|
||||
SET_AVAILABLE_SKINS,
|
||||
NETWORK_CONNECTED,
|
||||
NETWORK_DISCONNECTED
|
||||
} from "./actionTypes";
|
||||
|
|
@ -45,7 +45,7 @@ class Winamp {
|
|||
this.options = options;
|
||||
const {
|
||||
initialTracks,
|
||||
avaliableSkins,
|
||||
availableSkins,
|
||||
enableHotkeys = false
|
||||
} = this.options;
|
||||
|
||||
|
|
@ -67,10 +67,10 @@ class Winamp {
|
|||
if (initialTracks) {
|
||||
this.appendTracks(initialTracks);
|
||||
}
|
||||
if (avaliableSkins) {
|
||||
if (availableSkins) {
|
||||
this.store.dispatch({
|
||||
type: SET_AVALIABLE_SKINS,
|
||||
skins: avaliableSkins
|
||||
type: SET_AVAILABLE_SKINS,
|
||||
skins: availableSkins
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue