From 2bc53d12ea136b3ce224eb3cbc94cdd338945e12 Mon Sep 17 00:00:00 2001 From: Calvin Tam Date: Wed, 12 Aug 2015 23:38:39 -0700 Subject: [PATCH] Use double quote for html strings --- src/js/plyr.js | 150 ++++++++++++++++++++++++------------------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/src/js/plyr.js b/src/js/plyr.js index d352c5c4..84a01225 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -29,16 +29,16 @@ controls: ".player-controls", labels: "[data-player] .sr-only, label .sr-only", buttons: { - seek: "[data-player='seek']", - play: "[data-player='play']", - pause: "[data-player='pause']", - restart: "[data-player='restart']", - rewind: "[data-player='rewind']", - forward: "[data-player='fast-forward']", - mute: "[data-player='mute']", - volume: "[data-player='volume']", - captions: "[data-player='captions']", - fullscreen: "[data-player='fullscreen']" + seek: '[data-player="seek"]', + play: '[data-player="play"]', + pause: '[data-player="pause"]', + restart: '[data-player="restart"]', + rewind: '[data-player="rewind"]', + forward: '[data-player="fast-forward"]', + mute: '[data-player="mute"]', + volume: '[data-player="volume"]', + captions: '[data-player="captions"]', + fullscreen: '[data-player="fullscreen"]' }, progress: { container: ".player-progress", @@ -104,134 +104,134 @@ function _buildControls() { // Open and add the progress and seek elements var html = [ - "
", - "
", - "", - "", - "", - "0% " + config.i18n.played, - "", - "", - "0% " + config.i18n.buffered, - "", - "
", - ""]; + '
', + '
', + '', + '', + '', + '0% ' + config.i18n.played, + '', + '', + '0% ' + config.i18n.buffered, + '', + '
', + '']; // Restart button if (_inArray(config.controls, "restart")) { html.push( - "" + '' ); } // Rewind button if (_inArray(config.controls, "rewind")) { html.push( - "" + '' ); } // Play/pause button if (_inArray(config.controls, "play")) { html.push( - "", - "" + '', + '' ); } // Fast forward button if (_inArray(config.controls, "fast-forward")) { html.push( - "" + '' ); } // Media current time display if (_inArray(config.controls, "current-time")) { html.push( - "", - "" + config.i18n.currentTime + "", - "00:00", - "" + '', + '' + config.i18n.currentTime + '', + '00:00', + '' ); } // Media duration display if (_inArray(config.controls, "duration")) { html.push( - "", - "" + config.i18n.duration + "", - "00:00", - "" + '', + '' + config.i18n.duration + '', + '00:00', + '' ); } // Close left controls html.push( - "", - "" + '', + '' ); // Toggle mute button if (_inArray(config.controls, "mute")) { html.push( - "" + '' ); } // Volume range control if (_inArray(config.controls, "volume")) { html.push( - "", - "" + '', + '' ); } // Toggle captions button if (_inArray(config.controls, "captions")) { html.push( - "" + '' ); } // Toggle fullscreen button if (_inArray(config.controls, "fullscreen")) { html.push( - "" + '' ); } // Close everything html.push( - "", - "
" + '
', + '
' ); return html.join(""); @@ -346,7 +346,7 @@ // Inject a script function _injectScript(source) { - if (document.querySelectorAll("script[src='" + source + "']").length) { + if (document.querySelectorAll('script[src="' + source + '"]').length) { return; } @@ -777,7 +777,7 @@ // Inputs player.buttons.mute = _getElement(config.selectors.buttons.mute); player.buttons.captions = _getElement(config.selectors.buttons.captions); - player.checkboxes = _getElements("[type='checkbox']"); + player.checkboxes = _getElements('[type="checkbox"]'); // Progress player.progress = {}; @@ -882,7 +882,7 @@ // Setup YouTube function _setupYouTube(id) { // Remove old containers - var containers = _getElements("[id^='youtube']"); + var containers = _getElements('[id^="youtube"]'); for (var i = containers.length - 1; i >= 0; i--) { _remove(containers[i]); } @@ -1028,7 +1028,7 @@ function _setupCaptions() { if (player.type === "video") { // Inject the container - player.videoContainer.insertAdjacentHTML("afterbegin", "
"); + player.videoContainer.insertAdjacentHTML("afterbegin", '
'); // Cache selector player.captionsContainer = _getElement(config.selectors.captions).querySelector("span");