Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
thijstriemstra committed Oct 9, 2018
1 parent 3b24bc6 commit 05d9cca
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 39 deletions.
2 changes: 1 addition & 1 deletion spec/test-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const TestHelpers = {
},

/**
* Handle creating wavesurfer ui requirements
* Handle creating wavesurfer UI requirements
*
* @param {Object} options
*/
Expand Down
4 changes: 2 additions & 2 deletions spec/wavesurfer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('WaveSurfer/playback:', function() {

/** @test {WaveSurfer#getCurrentTime} */
it('should get currentTime', function() {
// initally zero
// initially zero
let time = wavesurfer.getCurrentTime();
expect(time).toEqual(0);

Expand All @@ -98,7 +98,7 @@ describe('WaveSurfer/playback:', function() {

/** @test {WaveSurfer#setCurrentTime} */
it('should set currentTime', function() {
// initally zero
// initially zero
let time = wavesurfer.getCurrentTime();
expect(time).toEqual(0);

Expand Down
7 changes: 4 additions & 3 deletions src/drawer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as util from './util';

/**
* Parent class for renderers
*
Expand Down Expand Up @@ -170,7 +171,7 @@ export default class Drawer extends util.Observer {
}

/**
* Recenter the viewport at a certain percent of the waveform
* Recenter the view-port at a certain percent of the waveform
*
* @param {number} percent Value from 0 to 1 on the waveform
*/
Expand All @@ -180,7 +181,7 @@ export default class Drawer extends util.Observer {
}

/**
* Recenter the viewport on a position, either scroll there immediately or
* Recenter the view-port on a position, either scroll there immediately or
* in steps of 5 pixels
*
* @param {number} position X-offset in pixels
Expand Down Expand Up @@ -294,7 +295,7 @@ export default class Drawer extends util.Observer {
}

/**
* Called by wavesurfer when progress should be renderered
* Called by wavesurfer when progress should be rendered
*
* @param {number} progress From 0 to 1
*/
Expand Down
12 changes: 7 additions & 5 deletions src/drawer.multicanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export default class MultiCanvas extends Drawer {
);

/**
* Whether or not the progress wave is renderered. If the `waveColor`
* and `progressColor` are the same colour it is not.
* Whether or not the progress wave is rendered. If the `waveColor`
* and `progressColor` are the same color it is not.
* @type {boolean}
*/
this.hasProgressCanvas = params.waveColor != params.progressColor;
Expand All @@ -58,7 +58,7 @@ export default class MultiCanvas extends Drawer {
}

/**
* Initialise the drawer
* Initialize the drawer
*/
init() {
this.createWrapper();
Expand Down Expand Up @@ -119,7 +119,8 @@ export default class MultiCanvas extends Drawer {
}

this.canvases.forEach((entry, i) => {
// Add some overlap to prevent vertical white stripes, keep the width even for simplicity.
// Add some overlap to prevent vertical white stripes, keep the
// width even for simplicity
let canvasWidth =
this.maxCanvasWidth + 2 * Math.ceil(this.params.pixelRatio / 2);

Expand Down Expand Up @@ -197,7 +198,8 @@ export default class MultiCanvas extends Drawer {
const elementWidth = Math.round(width / this.params.pixelRatio);
const totalWidth = Math.round(this.width / this.params.pixelRatio);

// Where the canvas starts and ends in the waveform, represented as a decimal between 0 and 1.
// Where the canvas starts and ends in the waveform, represented as a
// decimal between 0 and 1.
entry.start = entry.waveCtx.canvas.offsetLeft / totalWidth || 0;
entry.end = entry.start + elementWidth / totalWidth;

Expand Down
14 changes: 7 additions & 7 deletions src/html-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import loadScript from 'load-script';
*/
class Init {
/**
* Instantiate Init class and initialise elements
* Instantiate Init class and initialize elements
*
* This is done automatically if `window` is defined and
* `window.WS_StopAutoInit` is not set to true
Expand Down Expand Up @@ -87,7 +87,7 @@ class Init {
// @TODO insert plugin CDN URIs
pluginCdnTemplate:
'//localhost:8080/dist/plugin/wavesurfer.[name].js',
// loadPlugin function can be overriden to inject plugin definition
// loadPlugin function can be overridden to inject plugin definition
// objects, this default function uses load-script to load a plugin
// and pass it to a callback
loadPlugin(name, cb) {
Expand Down Expand Up @@ -127,7 +127,7 @@ class Init {
}

/**
* Initialise all container elements
* Initialize all container elements
*/
initAllEls() {
// iterate over all the container elements
Expand Down Expand Up @@ -161,15 +161,15 @@ class Init {
}

/**
* Initialise a single container element and add to `this.instances`
* Initialize a single container element and add to `this.instances`
*
* @param {HTMLElement} el The container to instantiate wavesurfer to
* @param {PluginDefinition[]} plugins An Array of plugin names to initialise with
* @param {PluginDefinition[]} plugins An Array of plugin names to initialize with
* @return {Object} Wavesurfer instance
*/
initEl(el, plugins = []) {
const jsonRegex = /^[[|{]/;
// initialise plugins with the correct options
// initialize plugins with the correct options
const initialisedPlugins = plugins.map(plugin => {
const options = {};
// the regex to find this plugin attributes
Expand Down Expand Up @@ -206,7 +206,7 @@ class Init {
// @TODO make nicer
el.style.display = 'block';

// initialise wavesurfer, load audio (with peaks if provided)
// initialize wavesurfer, load audio (with peaks if provided)
const instance = this.WaveSurfer.create(params);
const peaks = params.peaks ? JSON.parse(params.peaks) : undefined;
instance.load(params.url, peaks);
Expand Down
5 changes: 3 additions & 2 deletions src/mediaelement.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export default class MediaElement extends WebAudio {

this.on('play', onAudioProcess);

// Update the progress one more time to prevent it from being stuck in case of lower framerates
// Update the progress one more time to prevent it from being stuck in
// case of lower framerates
this.on('pause', () => {
this.fireEvent('audioprocess', this.getCurrentTime());
});
Expand Down Expand Up @@ -192,7 +193,7 @@ export default class MediaElement extends WebAudio {
}

/**
* Returns the current time in seconds relative to the audioclip's
* Returns the current time in seconds relative to the audio-clip's
* duration.
*
* @return {number}
Expand Down
2 changes: 1 addition & 1 deletion src/peakcache.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Caches the decoded peaks data to improve rendering speed for lage audio
* Caches the decoded peaks data to improve rendering speed for large audio
*
* Is used if the option parameter `partialRender` is set to `true`
*/
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default class CursorPlugin {
/** @private */
this.style = ws.util.style;
/**
* The cursor html element
* The cursor HTML element
*
* @type {?HTMLElement}
*/
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/elan.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @typedef {Object} ElanPluginParams
* @property {string|HTMLElement} container CSS selector or HTML element where
* the ELAN information should be renderer.
* the ELAN information should be rendered.
* @property {string} url The location of ELAN XML data
* @property {?boolean} deferInit Set to true to manually call
* @property {?Object} tiers If set only shows the data tiers with the `TIER_ID`
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/mediasession.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

/**
* Visualise MediaSession information for a wavesurfer instance.
* Visualize MediaSession information for a wavesurfer instance.
*
* @implements {PluginClass}
* @extends {Observer}
Expand Down
6 changes: 3 additions & 3 deletions src/plugin/microphone.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

/**
* Visualise microphone input in a wavesurfer instance.
* Visualize microphone input in a wavesurfer instance.
*
* @implements {PluginClass}
* @extends {Observer}
Expand Down Expand Up @@ -71,7 +71,7 @@ export default class MicrophonePlugin {
successCallback,
errorCallback
) => {
// get ahold of getUserMedia, if present
// get a hold of getUserMedia, if present
const getUserMedia =
navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
Expand Down Expand Up @@ -141,7 +141,7 @@ export default class MicrophonePlugin {
}

/**
* Allow user to select audio input device, eg. microphone, and
* Allow user to select audio input device, e.g. microphone, and
* start the visualization.
*/
start() {
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/minimap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @typedef {Object} MinimapPluginParams
* @desc Extends the `WavesurferParams` wavesurfer was initialised with
* @property {?string|HTMLElement} container CSS selector or HTML element where
* the ELAN information should be renderer. By default it is simply appended
* the map should be rendered. By default it is simply appended
* after the waveform.
* @property {?boolean} deferInit Set to true to manually call
* `initPlugin('minimap')`
Expand Down
6 changes: 3 additions & 3 deletions src/plugin/regions.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ class Region {

/**
* @typedef {Object} RegionsPluginParams
* @property {?boolean} dragSelection Enable creating regions by dragging wih
* @property {?boolean} dragSelection Enable creating regions by dragging with
* the mouse
* @property {?RegionParams[]} regions Regions that should be added upon
* initialisation
Expand All @@ -531,8 +531,8 @@ class Region {
* @property {number} start=0 The start position of the region (in seconds).
* @property {number} end=0 The end position of the region (in seconds).
* @property {?boolean} loop Whether to loop the region when played back.
* @property {boolean} drag=true Allow/dissallow dragging the region.
* @property {boolean} resize=true Allow/dissallow resizing the region.
* @property {boolean} drag=true Allow/disallow dragging the region.
* @property {boolean} resize=true Allow/disallow resizing the region.
* @property {string} [color='rgba(0, 0, 0, 0.1)'] HTML color code.
*/

Expand Down
2 changes: 1 addition & 1 deletion src/plugin/spectrogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ const FFT = function(bufferSize, sampleRate, windowFunc, alpha) {
* @property {string|HTMLElement} container Selector of element or element in
* which to render
* @property {number} fftSamples=512 number of samples to fetch to FFT. Must be
* a pwer of 2.
* a power of 2.
* @property {number} noverlap Size of the overlapping window. Must be <
* fftSamples. Auto deduced from canvas size by default.
* @property {string} windowFunc='hann' The window function to be used. One of
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export default class TimelinePlugin {
* @private
*/
updateCanvasesPositioning() {
// cache length for perf
// cache length for performance
const canvasesLength = this.canvases.length;
this.canvases.forEach((canvas, i) => {
// canvas width is the max element width, or if it is the last the
Expand Down
8 changes: 4 additions & 4 deletions src/wavesurfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ import PeakCache from './peakcache';
* (see fillParent).
* @property {number} skipLength=2 Number of seconds to skip with the
* skipForward() and skipBackward() methods.
* @property {boolean} splitChannels=false Render with seperate waveforms for
* @property {boolean} splitChannels=false Render with separate waveforms for
* the channels of the audio
* @property {string} waveColor='#999' The fill color of the waveform after the
* cursor.
Expand Down Expand Up @@ -327,7 +327,7 @@ export default class WaveSurfer extends util.Observer {

/**
* @private Will hold a list of event descriptors that need to be
* cancelled on subsequent loads of audio
* canceled on subsequent loads of audio
* @type {Object[]}
*/
this.tmpEvents = [];
Expand Down Expand Up @@ -859,7 +859,7 @@ export default class WaveSurfer extends util.Observer {
}

/**
* Toggle the volume on and off. It not currenly muted it will save the
* Toggle the volume on and off. If not currently muted it will save the
* current volume value and turn the volume off. If currently muted then it
* will restore the volume to the saved value, and then rest the saved
* value.
Expand Down Expand Up @@ -1038,7 +1038,7 @@ export default class WaveSurfer extends util.Observer {
}

/**
* Get the correct peaks for current wave viewport and render wave
* Get the correct peaks for current wave view-port and render wave
*
* @private
* @emits WaveSurfer#redraw
Expand Down
4 changes: 2 additions & 2 deletions src/webaudio.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as util from './util';

// using consts to prevent someone writing the string wrong
// using constants to prevent someone writing the string wrong
const PLAYING = 'playing';
const PAUSED = 'paused';
const FINISHED = 'finished';
Expand Down Expand Up @@ -654,7 +654,7 @@ export default class WebAudio extends util.Observer {
}

/**
* Returns the current time in seconds relative to the audioclip's
* Returns the current time in seconds relative to the audio-clip's
* duration.
*
* @return {number}
Expand Down

0 comments on commit 05d9cca

Please sign in to comment.