Initial commit
BIN
www/backup/bk/wp-includes/js/mediaelement/background.png
Normal file
|
After Width: | Height: | Size: 166 B |
BIN
www/backup/bk/wp-includes/js/mediaelement/bigplay.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
14
www/backup/bk/wp-includes/js/mediaelement/bigplay.svg
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<svg id="bigplay" viewBox="0 0 100 200" style="background-color:#ffffff00" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
|
||||
x="0px" y="0px" width="100px" height="200px"
|
||||
>
|
||||
<g id="dark">
|
||||
<path id="Polygon" d="M 72.5 49.5 L 38.75 68.9856 L 38.75 30.0144 L 72.5 49.5 Z" fill="#ffffff" opacity="0.75" />
|
||||
<path id="Ellipse" d="M 13 50.5 C 13 29.7891 29.7891 13 50.5 13 C 71.2109 13 88 29.7891 88 50.5 C 88 71.2109 71.2109 88 50.5 88 C 29.7891 88 13 71.2109 13 50.5 Z" stroke="#ffffff" stroke-width="5" fill="none" opacity="0.75"/>
|
||||
</g>
|
||||
<g id="light">
|
||||
<path id="Polygon2" d="M 72.5 149.5 L 38.75 168.9856 L 38.75 130.0144 L 72.5 149.5 Z" fill="#ffffff" opacity="1.0" />
|
||||
<path id="Ellipse2" d="M 13 150.5 C 13 129.7891 29.7891 113 50.5 113 C 71.2109 113 88 129.7891 88 150.5 C 88 171.211 71.2109 188 50.5 188 C 29.7891 188 13 171.211 13 150.5 Z" stroke="#ffffff" stroke-width="5" fill="none" opacity="1.0"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
BIN
www/backup/bk/wp-includes/js/mediaelement/controls.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
1
www/backup/bk/wp-includes/js/mediaelement/controls.svg
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
www/backup/bk/wp-includes/js/mediaelement/flashmediaelement.swf
Normal file
4
www/backup/bk/wp-includes/js/mediaelement/froogaloop.min.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
var Froogaloop=function(){function e(a){return new e.fn.init(a)}function h(a,c,b){if(!b.contentWindow.postMessage)return!1;var f=b.getAttribute("src").split("?")[0],a=JSON.stringify({method:a,value:c});"//"===f.substr(0,2)&&(f=window.location.protocol+f);b.contentWindow.postMessage(a,f)}function j(a){var c,b;try{c=JSON.parse(a.data),b=c.event||c.method}catch(f){}"ready"==b&&!i&&(i=!0);if(a.origin!=k)return!1;var a=c.value,e=c.data,g=""===g?null:c.player_id;c=g?d[g][b]:d[b];b=[];if(!c)return!1;void 0!==
|
||||
a&&b.push(a);e&&b.push(e);g&&b.push(g);return 0<b.length?c.apply(null,b):c.call()}function l(a,c,b){b?(d[b]||(d[b]={}),d[b][a]=c):d[a]=c}var d={},i=!1,k="";e.fn=e.prototype={element:null,init:function(a){"string"===typeof a&&(a=document.getElementById(a));this.element=a;a=this.element.getAttribute("src");"//"===a.substr(0,2)&&(a=window.location.protocol+a);for(var a=a.split("/"),c="",b=0,f=a.length;b<f;b++){if(3>b)c+=a[b];else break;2>b&&(c+="/")}k=c;return this},api:function(a,c){if(!this.element||
|
||||
!a)return!1;var b=this.element,f=""!==b.id?b.id:null,d=!c||!c.constructor||!c.call||!c.apply?c:null,e=c&&c.constructor&&c.call&&c.apply?c:null;e&&l(a,e,f);h(a,d,b);return this},addEvent:function(a,c){if(!this.element)return!1;var b=this.element,d=""!==b.id?b.id:null;l(a,c,d);"ready"!=a?h("addEventListener",a,b):"ready"==a&&i&&c.call(null,d);return this},removeEvent:function(a){if(!this.element)return!1;var c=this.element,b;a:{if((b=""!==c.id?c.id:null)&&d[b]){if(!d[b][a]){b=!1;break a}d[b][a]=null}else{if(!d[a]){b=
|
||||
!1;break a}d[a]=null}b=!0}"ready"!=a&&b&&h("removeEventListener",a,c)}};e.fn.init.prototype=e.fn;window.addEventListener?window.addEventListener("message",j,!1):window.attachEvent("onmessage",j);return window.Froogaloop=window.$f=e}();
|
||||
BIN
www/backup/bk/wp-includes/js/mediaelement/jumpforward.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
www/backup/bk/wp-includes/js/mediaelement/loading.gif
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
28
www/backup/bk/wp-includes/js/mediaelement/mediaelement-and-player.min.js
vendored
Normal file
1
www/backup/bk/wp-includes/js/mediaelement/mediaelementplayer.min.css
vendored
Normal file
BIN
www/backup/bk/wp-includes/js/mediaelement/skipback.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
312
www/backup/bk/wp-includes/js/mediaelement/wp-mediaelement.css
Normal file
@@ -0,0 +1,312 @@
|
||||
.mejs-container {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.mejs-container * {
|
||||
font-family: Helvetica, Arial;
|
||||
}
|
||||
|
||||
.mejs-container,
|
||||
.mejs-embed,
|
||||
.mejs-embed body,
|
||||
.mejs-container .mejs-controls {
|
||||
background: #222;
|
||||
}
|
||||
|
||||
.mejs-controls a.mejs-horizontal-volume-slider {
|
||||
display: table;
|
||||
}
|
||||
|
||||
.mejs-controls .mejs-time-rail .mejs-time-loaded,
|
||||
.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.mejs-controls .mejs-time-rail .mejs-time-current {
|
||||
background: #0073aa;
|
||||
}
|
||||
|
||||
.mejs-controls .mejs-time-rail .mejs-time-total,
|
||||
.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total {
|
||||
background: rgba(255, 255, 255, .33);
|
||||
}
|
||||
|
||||
.mejs-controls .mejs-time-rail span,
|
||||
.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total,
|
||||
.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.mejs-controls .mejs-offscreen {
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.mejs-controls a:focus > .mejs-offscreen {
|
||||
background-color: #f1f1f1;
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
|
||||
clip: auto;
|
||||
color: #0073aa;
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
height: auto;
|
||||
line-height: normal;
|
||||
padding: 15px 23px 14px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 15px;
|
||||
text-decoration: none;
|
||||
text-transform: none;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.mejs-overlay-loading {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* Override theme styles that may conflict with controls. */
|
||||
.mejs-controls button:hover {
|
||||
border: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.me-cannotplay {
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
.media-embed-details .wp-audio-shortcode {
|
||||
display: inline-block;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.audio-details .embed-media-settings {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.media-embed-details .embed-media-settings .setting span {
|
||||
max-width: 400px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.media-embed-details .embed-media-settings .checkbox-setting span {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.media-embed-details .embed-media-settings {
|
||||
padding-top: 0;
|
||||
top: 28px;
|
||||
}
|
||||
|
||||
.media-embed-details .instructions {
|
||||
padding: 16px 0;
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
.media-embed-details .setting p,
|
||||
.media-embed-details .setting .remove-setting {
|
||||
color: #a00;
|
||||
font-size: 10px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.media-embed-details .setting .remove-setting {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.media-embed-details .setting a:hover {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.media-embed-details .embed-media-settings .checkbox-setting {
|
||||
float: none;
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
|
||||
.wp-video {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.wp_attachment_holder .wp-video,
|
||||
.wp_attachment_holder .wp-audio-shortcode {
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
video.wp-video-shortcode,
|
||||
.wp-video-shortcode video {
|
||||
max-width: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.video-details .wp-video-holder {
|
||||
width: 100%;
|
||||
max-width: 640px;
|
||||
}
|
||||
|
||||
.wp-playlist {
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px;
|
||||
margin: 12px 0 18px;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.wp-admin .wp-playlist {
|
||||
margin: 0 0 18px;
|
||||
}
|
||||
|
||||
.wp-playlist video {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.wp-playlist audio {
|
||||
display: none;
|
||||
max-width: 100%;
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.wp-playlist .mejs-container {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wp-playlist .mejs-controls .mejs-button button {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.wp-playlist-light {
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.wp-playlist-dark {
|
||||
color: #fff;
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.wp-playlist-caption {
|
||||
display: block;
|
||||
max-width: 88%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.wp-playlist-item .wp-playlist-caption {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
max-width: -webkit-calc(100% - 40px);
|
||||
max-width: calc(100% - 40px);
|
||||
}
|
||||
|
||||
.wp-playlist-item-meta {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.wp-playlist-item-title {
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.wp-playlist-item-album {
|
||||
font-style: italic;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.wp-playlist-item-artist {
|
||||
font-size: 12px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.wp-playlist-item-length {
|
||||
position: absolute;
|
||||
right: 3px;
|
||||
top: 0;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.rtl .wp-playlist-item-length {
|
||||
left: 3px;
|
||||
right: auto;
|
||||
}
|
||||
|
||||
.wp-playlist-tracks {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.wp-playlist-item {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
padding: 0 3px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.wp-playlist-item:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.wp-playlist-light .wp-playlist-caption {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.wp-playlist-dark .wp-playlist-caption {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.wp-playlist-playing {
|
||||
font-weight: bold;
|
||||
background: #f7f7f7;
|
||||
}
|
||||
|
||||
.wp-playlist-light .wp-playlist-playing {
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.wp-playlist-dark .wp-playlist-playing {
|
||||
background: #000;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.wp-playlist-current-item {
|
||||
overflow: hidden;
|
||||
margin-bottom: 10px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
.wp-playlist .wp-playlist-current-item img {
|
||||
float: left;
|
||||
max-width: 60px;
|
||||
height: auto;
|
||||
margin-right: 10px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.rtl .wp-playlist .wp-playlist-current-item img {
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.wp-playlist-current-item .wp-playlist-item-title,
|
||||
.wp-playlist-current-item .wp-playlist-item-artist {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.wp-audio-playlist .me-cannotplay span {
|
||||
padding: 5px 15px;
|
||||
}
|
||||
61
www/backup/bk/wp-includes/js/mediaelement/wp-mediaelement.js
Normal file
@@ -0,0 +1,61 @@
|
||||
/* global mejs, _wpmejsSettings */
|
||||
(function( window, $ ) {
|
||||
|
||||
window.wp = window.wp || {};
|
||||
|
||||
// add mime-type aliases to MediaElement plugin support
|
||||
mejs.plugins.silverlight[0].types.push('video/x-ms-wmv');
|
||||
mejs.plugins.silverlight[0].types.push('audio/x-ms-wma');
|
||||
|
||||
function wpMediaElement() {
|
||||
var settings = {};
|
||||
|
||||
/**
|
||||
* Initialize media elements.
|
||||
*
|
||||
* Ensures media elements that have already been initialized won't be
|
||||
* processed again.
|
||||
*
|
||||
* @since 4.4.0
|
||||
*/
|
||||
function initialize() {
|
||||
if ( typeof _wpmejsSettings !== 'undefined' ) {
|
||||
settings = $.extend( true, {}, _wpmejsSettings );
|
||||
}
|
||||
|
||||
settings.success = settings.success || function (mejs) {
|
||||
var autoplay, loop;
|
||||
|
||||
if ( 'flash' === mejs.pluginType ) {
|
||||
autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay;
|
||||
loop = mejs.attributes.loop && 'false' !== mejs.attributes.loop;
|
||||
|
||||
autoplay && mejs.addEventListener( 'canplay', function () {
|
||||
mejs.play();
|
||||
}, false );
|
||||
|
||||
loop && mejs.addEventListener( 'ended', function () {
|
||||
mejs.play();
|
||||
}, false );
|
||||
}
|
||||
};
|
||||
|
||||
// Only initialize new media elements.
|
||||
$( '.wp-audio-shortcode, .wp-video-shortcode' )
|
||||
.not( '.mejs-container' )
|
||||
.filter(function () {
|
||||
return ! $( this ).parent().hasClass( '.mejs-mediaelement' );
|
||||
})
|
||||
.mediaelementplayer( settings );
|
||||
}
|
||||
|
||||
return {
|
||||
initialize: initialize
|
||||
};
|
||||
}
|
||||
|
||||
window.wp.mediaelement = new wpMediaElement();
|
||||
|
||||
$( window.wp.mediaelement.initialize );
|
||||
|
||||
})( window, jQuery );
|
||||
1
www/backup/bk/wp-includes/js/mediaelement/wp-mediaelement.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.mejs-container{clear:both}.mejs-container *{font-family:Helvetica,Arial}.mejs-container,.mejs-container .mejs-controls,.mejs-embed,.mejs-embed body{background:#222}.mejs-controls a.mejs-horizontal-volume-slider{display:table}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current,.mejs-controls .mejs-time-rail .mejs-time-loaded{background:#fff}.mejs-controls .mejs-time-rail .mejs-time-current{background:#0073aa}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total,.mejs-controls .mejs-time-rail .mejs-time-total{background:rgba(255,255,255,.33)}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current,.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total,.mejs-controls .mejs-time-rail span{border-radius:0}.mejs-controls .mejs-offscreen{clip:rect(1px,1px,1px,1px);position:absolute}.mejs-controls a:focus>.mejs-offscreen{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto;color:#0073aa;display:block;font-size:14px;font-weight:700;height:auto;line-height:normal;padding:15px 23px 14px;position:absolute;left:0;top:15px;text-decoration:none;text-transform:none;width:auto}.mejs-overlay-loading{background:0 0}.mejs-controls button:hover{border:none;-webkit-box-shadow:none;box-shadow:none}.me-cannotplay{width:auto!important}.media-embed-details .wp-audio-shortcode{display:inline-block;max-width:400px}.audio-details .embed-media-settings{overflow:visible}.media-embed-details .embed-media-settings .setting span{max-width:400px;width:auto}.media-embed-details .embed-media-settings .checkbox-setting span{display:inline-block}.media-embed-details .embed-media-settings{padding-top:0;top:28px}.media-embed-details .instructions{padding:16px 0;max-width:600px}.media-embed-details .setting .remove-setting,.media-embed-details .setting p{color:#a00;font-size:10px;text-transform:uppercase}.media-embed-details .setting .remove-setting{padding:0}.media-embed-details .setting a:hover{color:red}.media-embed-details .embed-media-settings .checkbox-setting{float:none;margin:0 0 10px}.wp-video{max-width:100%;height:auto}.wp_attachment_holder .wp-audio-shortcode,.wp_attachment_holder .wp-video{margin-top:18px}.wp-video-shortcode video,video.wp-video-shortcode{max-width:100%;display:inline-block}.video-details .wp-video-holder{width:100%;max-width:640px}.wp-playlist{border:1px solid #ccc;padding:10px;margin:12px 0 18px;font-size:14px;line-height:1.5}.wp-admin .wp-playlist{margin:0 0 18px}.wp-playlist video{display:inline-block;max-width:100%}.wp-playlist audio{display:none;max-width:100%;width:400px}.wp-playlist-caption,.wp-playlist-item-meta{display:block;font-size:14px;line-height:1.5}.wp-playlist .mejs-container{margin:0;width:100%}.wp-playlist .mejs-controls .mejs-button button{outline:0}.wp-playlist-light{background:#fff;color:#000}.wp-playlist-dark{color:#fff;background:#000}.wp-playlist-caption{max-width:88%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-playlist-item .wp-playlist-caption{text-decoration:none;color:#000;max-width:-webkit-calc(100% - 40px);max-width:calc(100% - 40px)}.wp-playlist-item-title{font-size:14px;line-height:1.5}.wp-playlist-item-album{font-style:italic;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-playlist-item-artist{font-size:12px;text-transform:uppercase}.wp-playlist-item-length{position:absolute;right:3px;top:0;font-size:14px;line-height:1.5}.rtl .wp-playlist-item-length{left:3px;right:auto}.wp-playlist-tracks{margin-top:10px}.wp-playlist-item{position:relative;cursor:pointer;padding:0 3px;border-bottom:1px solid #ccc}.wp-playlist-item:last-child{border-bottom:0}.wp-playlist-light .wp-playlist-caption{color:#333}.wp-playlist-dark .wp-playlist-caption{color:#ddd}.wp-playlist-playing{font-weight:700;background:#f7f7f7}.wp-playlist-light .wp-playlist-playing{background:#fff;color:#000}.wp-playlist-dark .wp-playlist-playing{background:#000;color:#fff}.wp-playlist-current-item{overflow:hidden;margin-bottom:10px;height:60px}.wp-playlist .wp-playlist-current-item img{float:left;max-width:60px;height:auto;margin-right:10px;padding:0;border:0}.rtl .wp-playlist .wp-playlist-current-item img{float:right;margin-left:10px;margin-right:0}.wp-playlist-current-item .wp-playlist-item-artist,.wp-playlist-current-item .wp-playlist-item-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-audio-playlist .me-cannotplay span{padding:5px 15px}
|
||||
1
www/backup/bk/wp-includes/js/mediaelement/wp-mediaelement.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(a,b){function c(){function a(){"undefined"!=typeof _wpmejsSettings&&(c=b.extend(!0,{},_wpmejsSettings)),c.success=c.success||function(a){var b,c;"flash"===a.pluginType&&(b=a.attributes.autoplay&&"false"!==a.attributes.autoplay,c=a.attributes.loop&&"false"!==a.attributes.loop,b&&a.addEventListener("canplay",function(){a.play()},!1),c&&a.addEventListener("ended",function(){a.play()},!1))},b(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").filter(function(){return!b(this).parent().hasClass(".mejs-mediaelement")}).mediaelementplayer(c)}var c={};return{initialize:a}}a.wp=a.wp||{},mejs.plugins.silverlight[0].types.push("video/x-ms-wmv"),mejs.plugins.silverlight[0].types.push("audio/x-ms-wma"),a.wp.mediaelement=new c,b(a.wp.mediaelement.initialize)}(window,jQuery);
|
||||
175
www/backup/bk/wp-includes/js/mediaelement/wp-playlist.js
Normal file
@@ -0,0 +1,175 @@
|
||||
/* global _wpmejsSettings, MediaElementPlayer */
|
||||
|
||||
(function ($, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
var WPPlaylistView = Backbone.View.extend({
|
||||
initialize : function (options) {
|
||||
this.index = 0;
|
||||
this.settings = {};
|
||||
this.data = options.metadata || $.parseJSON( this.$('script.wp-playlist-script').html() );
|
||||
this.playerNode = this.$( this.data.type );
|
||||
|
||||
this.tracks = new Backbone.Collection( this.data.tracks );
|
||||
this.current = this.tracks.first();
|
||||
|
||||
if ( 'audio' === this.data.type ) {
|
||||
this.currentTemplate = wp.template( 'wp-playlist-current-item' );
|
||||
this.currentNode = this.$( '.wp-playlist-current-item' );
|
||||
}
|
||||
|
||||
this.renderCurrent();
|
||||
|
||||
if ( this.data.tracklist ) {
|
||||
this.itemTemplate = wp.template( 'wp-playlist-item' );
|
||||
this.playingClass = 'wp-playlist-playing';
|
||||
this.renderTracks();
|
||||
}
|
||||
|
||||
this.playerNode.attr( 'src', this.current.get( 'src' ) );
|
||||
|
||||
_.bindAll( this, 'bindPlayer', 'bindResetPlayer', 'setPlayer', 'ended', 'clickTrack' );
|
||||
|
||||
if ( ! _.isUndefined( window._wpmejsSettings ) ) {
|
||||
this.settings = _.clone( _wpmejsSettings );
|
||||
}
|
||||
this.settings.success = this.bindPlayer;
|
||||
this.setPlayer();
|
||||
},
|
||||
|
||||
bindPlayer : function (mejs) {
|
||||
this.mejs = mejs;
|
||||
this.mejs.addEventListener( 'ended', this.ended );
|
||||
},
|
||||
|
||||
bindResetPlayer : function (mejs) {
|
||||
this.bindPlayer( mejs );
|
||||
this.playCurrentSrc();
|
||||
},
|
||||
|
||||
setPlayer: function (force) {
|
||||
if ( this.player ) {
|
||||
this.player.pause();
|
||||
this.player.remove();
|
||||
this.playerNode = this.$( this.data.type );
|
||||
}
|
||||
|
||||
if (force) {
|
||||
this.playerNode.attr( 'src', this.current.get( 'src' ) );
|
||||
this.settings.success = this.bindResetPlayer;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is also our bridge to the outside world
|
||||
*/
|
||||
this.player = new MediaElementPlayer( this.playerNode.get(0), this.settings );
|
||||
},
|
||||
|
||||
playCurrentSrc : function () {
|
||||
this.renderCurrent();
|
||||
this.mejs.setSrc( this.playerNode.attr( 'src' ) );
|
||||
this.mejs.load();
|
||||
this.mejs.play();
|
||||
},
|
||||
|
||||
renderCurrent : function () {
|
||||
var dimensions, defaultImage = 'wp-includes/images/media/video.png';
|
||||
if ( 'video' === this.data.type ) {
|
||||
if ( this.data.images && this.current.get( 'image' ) && -1 === this.current.get( 'image' ).src.indexOf( defaultImage ) ) {
|
||||
this.playerNode.attr( 'poster', this.current.get( 'image' ).src );
|
||||
}
|
||||
dimensions = this.current.get( 'dimensions' ).resized;
|
||||
this.playerNode.attr( dimensions );
|
||||
} else {
|
||||
if ( ! this.data.images ) {
|
||||
this.current.set( 'image', false );
|
||||
}
|
||||
this.currentNode.html( this.currentTemplate( this.current.toJSON() ) );
|
||||
}
|
||||
},
|
||||
|
||||
renderTracks : function () {
|
||||
var self = this, i = 1, tracklist = $( '<div class="wp-playlist-tracks"></div>' );
|
||||
this.tracks.each(function (model) {
|
||||
if ( ! self.data.images ) {
|
||||
model.set( 'image', false );
|
||||
}
|
||||
model.set( 'artists', self.data.artists );
|
||||
model.set( 'index', self.data.tracknumbers ? i : false );
|
||||
tracklist.append( self.itemTemplate( model.toJSON() ) );
|
||||
i += 1;
|
||||
});
|
||||
this.$el.append( tracklist );
|
||||
|
||||
this.$( '.wp-playlist-item' ).eq(0).addClass( this.playingClass );
|
||||
},
|
||||
|
||||
events : {
|
||||
'click .wp-playlist-item' : 'clickTrack',
|
||||
'click .wp-playlist-next' : 'next',
|
||||
'click .wp-playlist-prev' : 'prev'
|
||||
},
|
||||
|
||||
clickTrack : function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
this.index = this.$( '.wp-playlist-item' ).index( e.currentTarget );
|
||||
this.setCurrent();
|
||||
},
|
||||
|
||||
ended : function () {
|
||||
if ( this.index + 1 < this.tracks.length ) {
|
||||
this.next();
|
||||
} else {
|
||||
this.index = 0;
|
||||
this.setCurrent();
|
||||
}
|
||||
},
|
||||
|
||||
next : function () {
|
||||
this.index = this.index + 1 >= this.tracks.length ? 0 : this.index + 1;
|
||||
this.setCurrent();
|
||||
},
|
||||
|
||||
prev : function () {
|
||||
this.index = this.index - 1 < 0 ? this.tracks.length - 1 : this.index - 1;
|
||||
this.setCurrent();
|
||||
},
|
||||
|
||||
loadCurrent : function () {
|
||||
var last = this.playerNode.attr( 'src' ) && this.playerNode.attr( 'src' ).split('.').pop(),
|
||||
current = this.current.get( 'src' ).split('.').pop();
|
||||
|
||||
this.mejs && this.mejs.pause();
|
||||
|
||||
if ( last !== current ) {
|
||||
this.setPlayer( true );
|
||||
} else {
|
||||
this.playerNode.attr( 'src', this.current.get( 'src' ) );
|
||||
this.playCurrentSrc();
|
||||
}
|
||||
},
|
||||
|
||||
setCurrent : function () {
|
||||
this.current = this.tracks.at( this.index );
|
||||
|
||||
if ( this.data.tracklist ) {
|
||||
this.$( '.wp-playlist-item' )
|
||||
.removeClass( this.playingClass )
|
||||
.eq( this.index )
|
||||
.addClass( this.playingClass );
|
||||
}
|
||||
|
||||
this.loadCurrent();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$('.wp-playlist').each( function() {
|
||||
return new WPPlaylistView({ el: this });
|
||||
} );
|
||||
});
|
||||
|
||||
window.WPPlaylistView = WPPlaylistView;
|
||||
|
||||
}(jQuery, _, Backbone));
|
||||
1
www/backup/bk/wp-includes/js/mediaelement/wp-playlist.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(a,b,c){"use strict";var d=c.View.extend({initialize:function(d){this.index=0,this.settings={},this.data=d.metadata||a.parseJSON(this.$("script.wp-playlist-script").html()),this.playerNode=this.$(this.data.type),this.tracks=new c.Collection(this.data.tracks),this.current=this.tracks.first(),"audio"===this.data.type&&(this.currentTemplate=wp.template("wp-playlist-current-item"),this.currentNode=this.$(".wp-playlist-current-item")),this.renderCurrent(),this.data.tracklist&&(this.itemTemplate=wp.template("wp-playlist-item"),this.playingClass="wp-playlist-playing",this.renderTracks()),this.playerNode.attr("src",this.current.get("src")),b.bindAll(this,"bindPlayer","bindResetPlayer","setPlayer","ended","clickTrack"),b.isUndefined(window._wpmejsSettings)||(this.settings=b.clone(_wpmejsSettings)),this.settings.success=this.bindPlayer,this.setPlayer()},bindPlayer:function(a){this.mejs=a,this.mejs.addEventListener("ended",this.ended)},bindResetPlayer:function(a){this.bindPlayer(a),this.playCurrentSrc()},setPlayer:function(a){this.player&&(this.player.pause(),this.player.remove(),this.playerNode=this.$(this.data.type)),a&&(this.playerNode.attr("src",this.current.get("src")),this.settings.success=this.bindResetPlayer),this.player=new MediaElementPlayer(this.playerNode.get(0),this.settings)},playCurrentSrc:function(){this.renderCurrent(),this.mejs.setSrc(this.playerNode.attr("src")),this.mejs.load(),this.mejs.play()},renderCurrent:function(){var a,b="wp-includes/images/media/video.png";"video"===this.data.type?(this.data.images&&this.current.get("image")&&-1===this.current.get("image").src.indexOf(b)&&this.playerNode.attr("poster",this.current.get("image").src),a=this.current.get("dimensions").resized,this.playerNode.attr(a)):(this.data.images||this.current.set("image",!1),this.currentNode.html(this.currentTemplate(this.current.toJSON())))},renderTracks:function(){var b=this,c=1,d=a('<div class="wp-playlist-tracks"></div>');this.tracks.each(function(a){b.data.images||a.set("image",!1),a.set("artists",b.data.artists),a.set("index",!!b.data.tracknumbers&&c),d.append(b.itemTemplate(a.toJSON())),c+=1}),this.$el.append(d),this.$(".wp-playlist-item").eq(0).addClass(this.playingClass)},events:{"click .wp-playlist-item":"clickTrack","click .wp-playlist-next":"next","click .wp-playlist-prev":"prev"},clickTrack:function(a){a.preventDefault(),this.index=this.$(".wp-playlist-item").index(a.currentTarget),this.setCurrent()},ended:function(){this.index+1<this.tracks.length?this.next():(this.index=0,this.setCurrent())},next:function(){this.index=this.index+1>=this.tracks.length?0:this.index+1,this.setCurrent()},prev:function(){this.index=this.index-1<0?this.tracks.length-1:this.index-1,this.setCurrent()},loadCurrent:function(){var a=this.playerNode.attr("src")&&this.playerNode.attr("src").split(".").pop(),b=this.current.get("src").split(".").pop();this.mejs&&this.mejs.pause(),a!==b?this.setPlayer(!0):(this.playerNode.attr("src",this.current.get("src")),this.playCurrentSrc())},setCurrent:function(){this.current=this.tracks.at(this.index),this.data.tracklist&&this.$(".wp-playlist-item").removeClass(this.playingClass).eq(this.index).addClass(this.playingClass),this.loadCurrent()}});a(document).ready(function(){a(".wp-playlist").each(function(){return new d({el:this})})}),window.WPPlaylistView=d}(jQuery,_,Backbone);
|
||||