update images
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 234 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 139 KiB |
Before Width: | Height: | Size: 262 KiB |
|
@ -682,10 +682,6 @@
|
|||
|
||||
return "<img src='css/images/clients/dlna.png' />";
|
||||
}
|
||||
if (clientLowered == "mbkinect") {
|
||||
|
||||
return "<img src='css/images/clients/mbkinect.png' />";
|
||||
}
|
||||
if (clientLowered == "kodi" || clientLowered == "xbmc") {
|
||||
return "<img src='css/images/clients/kodi.png' />";
|
||||
}
|
||||
|
|
|
@ -161,6 +161,15 @@
|
|||
});
|
||||
}
|
||||
|
||||
var directPlayAudioContainers = AppInfo.directPlayAudioContainers;
|
||||
|
||||
if (directPlayAudioContainers && directPlayAudioContainers.length) {
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: directPlayAudioContainers.join(','),
|
||||
Type: 'Audio'
|
||||
});
|
||||
}
|
||||
|
||||
if (canPlayWebm) {
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: 'webm',
|
||||
|
@ -449,15 +458,15 @@
|
|||
self.canPlayNativeHls = function () {
|
||||
|
||||
// Don't use HLS on android 4.x, regardless of what the browser reports
|
||||
if ($.browser.android) {
|
||||
var agent = navigator.userAgent.toLowerCase();
|
||||
//if ($.browser.android) {
|
||||
// var agent = navigator.userAgent.toLowerCase();
|
||||
|
||||
for (var i = 0; i <= 4; i++) {
|
||||
if (agent.indexOf('android 4.' + i) != -1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// for (var i = 0; i <= 4; i++) {
|
||||
// if (agent.indexOf('android 4.' + i) != -1) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
var media = document.createElement('video');
|
||||
|
||||
|
|
|
@ -1646,6 +1646,12 @@ var AppInfo = {};
|
|||
AppInfo.enableBackButton = (isIOS && window.navigator.standalone) || (isCordova && isIOS);
|
||||
AppInfo.supportsFullScreen = isCordova && isAndroid;
|
||||
AppInfo.supportsSyncPathSetting = isCordova && isAndroid;
|
||||
|
||||
if (isCordova && isAndroid) {
|
||||
AppInfo.directPlayAudioContainers = ['aac', 'mp3', 'ogg', 'flac', 'wma', 'm4a', 'oga'];
|
||||
} else {
|
||||
AppInfo.directPlayAudioContainers = [];
|
||||
}
|
||||
}
|
||||
|
||||
function initializeApiClient(apiClient) {
|
||||
|
|
|
@ -131,10 +131,10 @@
|
|||
self.report = function (eventName, duration, position, isPaused, volume) {
|
||||
|
||||
var state = playerState;
|
||||
console.log('Vlc: ' + eventName + ' - ' + position + ' - ' + duration);
|
||||
|
||||
state.duration = duration;
|
||||
state.currentTime = position;
|
||||
state.isPaused = isPaused;
|
||||
state.paused = isPaused;
|
||||
state.volume = (volume || 0) / 100;
|
||||
|
||||
if (eventName == 'playbackstop') {
|
||||
|
|
7073
dashboard-ui/thirdparty/jstree3.0.8/jstree.js
vendored
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 1.7 KiB |
|
@ -1,293 +0,0 @@
|
|||
/*! Swipebox v1.3.0 | Constantin Saguin csag.co | MIT License | github.com/brutaldesign/swipebox */
|
||||
html.swipebox-html.swipebox-touch {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
#swipebox-overlay img {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
#swipebox-overlay {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 99999 !important;
|
||||
overflow: hidden;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
#swipebox-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#swipebox-slider {
|
||||
-webkit-transition: -webkit-transform 0.4s ease;
|
||||
transition: transform 0.4s ease;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
position: absolute;
|
||||
display: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
#swipebox-slider .slide {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
line-height: 1px;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
||||
#swipebox-slider .slide:before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
height: 50%;
|
||||
width: 1px;
|
||||
margin-right: -1px;
|
||||
}
|
||||
#swipebox-slider .slide img, #swipebox-slider .slide .swipebox-video-container {
|
||||
display: inline-block;
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: auto;
|
||||
height: auto;
|
||||
vertical-align: middle;
|
||||
}
|
||||
#swipebox-slider .slide .swipebox-video-container {
|
||||
background: none;
|
||||
max-width: 1140px;
|
||||
max-height: 100%;
|
||||
width: 100%;
|
||||
padding: 5%;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
#swipebox-slider .slide .swipebox-video-container .swipebox-video {
|
||||
width: 100%;
|
||||
height: 0;
|
||||
padding-bottom: 56.25%;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
#swipebox-slider .slide .swipebox-video-container .swipebox-video iframe {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
#swipebox-slider .slide-loading {
|
||||
background: url(../img/loader.gif) no-repeat center center;
|
||||
}
|
||||
|
||||
#swipebox-bottom-bar,
|
||||
#swipebox-top-bar {
|
||||
-webkit-transition: 0.5s;
|
||||
transition: 0.5s;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
z-index: 999;
|
||||
height: 50px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#swipebox-bottom-bar {
|
||||
bottom: -50px;
|
||||
}
|
||||
#swipebox-bottom-bar.visible-bars {
|
||||
-webkit-transform: translate3d(0, -50px, 0);
|
||||
transform: translate3d(0, -50px, 0);
|
||||
}
|
||||
|
||||
#swipebox-top-bar {
|
||||
top: -50px;
|
||||
}
|
||||
#swipebox-top-bar.visible-bars {
|
||||
-webkit-transform: translate3d(0, 50px, 0);
|
||||
transform: translate3d(0, 50px, 0);
|
||||
}
|
||||
|
||||
#swipebox-title {
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#swipebox-prev,
|
||||
#swipebox-next,
|
||||
#swipebox-close {
|
||||
background-image: url(../img/icons.png);
|
||||
background-repeat: no-repeat;
|
||||
border: none !important;
|
||||
text-decoration: none !important;
|
||||
cursor: pointer;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
#swipebox-arrows {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
#swipebox-prev {
|
||||
background-position: -32px 13px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#swipebox-next {
|
||||
background-position: -78px 13px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#swipebox-close {
|
||||
top: 0;
|
||||
right: 0;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
background-position: 15px 12px;
|
||||
}
|
||||
|
||||
.swipebox-no-close-button #swipebox-close {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#swipebox-prev.disabled,
|
||||
#swipebox-next.disabled {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.swipebox-no-touch #swipebox-overlay.rightSpring #swipebox-slider {
|
||||
-webkit-animation: rightSpring 0.3s;
|
||||
animation: rightSpring 0.3s;
|
||||
}
|
||||
.swipebox-no-touch #swipebox-overlay.leftSpring #swipebox-slider {
|
||||
-webkit-animation: leftSpring 0.3s;
|
||||
animation: leftSpring 0.3s;
|
||||
}
|
||||
|
||||
.swipebox-touch #swipebox-container:before, .swipebox-touch #swipebox-container:after {
|
||||
-webkit-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
-webkit-transition: all .3s ease;
|
||||
transition: all .3s ease;
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
width: 20px;
|
||||
opacity: 0;
|
||||
}
|
||||
.swipebox-touch #swipebox-container:before {
|
||||
left: 0;
|
||||
-webkit-box-shadow: inset 10px 0px 10px -8px #656565;
|
||||
box-shadow: inset 10px 0px 10px -8px #656565;
|
||||
}
|
||||
.swipebox-touch #swipebox-container:after {
|
||||
right: 0;
|
||||
-webkit-box-shadow: inset -10px 0px 10px -8px #656565;
|
||||
box-shadow: inset -10px 0px 10px -8px #656565;
|
||||
}
|
||||
.swipebox-touch #swipebox-overlay.leftSpringTouch #swipebox-container:before {
|
||||
opacity: 1;
|
||||
}
|
||||
.swipebox-touch #swipebox-overlay.rightSpringTouch #swipebox-container:after {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rightSpring {
|
||||
0% {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
left: -30px;
|
||||
}
|
||||
|
||||
100% {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rightSpring {
|
||||
0% {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
left: -30px;
|
||||
}
|
||||
|
||||
100% {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes leftSpring {
|
||||
0% {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
left: 30px;
|
||||
}
|
||||
|
||||
100% {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
@keyframes leftSpring {
|
||||
0% {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
left: 30px;
|
||||
}
|
||||
|
||||
100% {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 800px) {
|
||||
#swipebox-close {
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
#swipebox-arrows {
|
||||
width: 92%;
|
||||
max-width: 800px;
|
||||
}
|
||||
}
|
||||
/* Skin
|
||||
--------------------------*/
|
||||
#swipebox-overlay {
|
||||
background: #0d0d0d;
|
||||
}
|
||||
|
||||
#swipebox-bottom-bar,
|
||||
#swipebox-top-bar {
|
||||
text-shadow: 1px 1px 1px black;
|
||||
background: #000;
|
||||
opacity: 0.95;
|
||||
}
|
||||
|
||||
#swipebox-top-bar {
|
||||
color: white !important;
|
||||
font-size: 15px;
|
||||
line-height: 43px;
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
}
|
|
@ -1,874 +0,0 @@
|
|||
/*! Swipebox v1.3.0.2 | Constantin Saguin csag.co | MIT License | github.com/brutaldesign/swipebox */
|
||||
|
||||
;( function ( window, document, $, undefined ) {
|
||||
|
||||
$.swipebox = function( elem, options ) {
|
||||
|
||||
// Default options
|
||||
var ui,
|
||||
defaults = {
|
||||
useCSS : true,
|
||||
useSVG : true,
|
||||
initialIndexOnArray : 0,
|
||||
hideCloseButtonOnMobile : false,
|
||||
hideBarsDelay : 3000,
|
||||
videoMaxWidth : 1140,
|
||||
vimeoColor : 'cccccc',
|
||||
beforeOpen: null,
|
||||
afterOpen: null,
|
||||
afterClose: null,
|
||||
loopAtEnd: false,
|
||||
autoplayVideos: false
|
||||
},
|
||||
|
||||
plugin = this,
|
||||
elements = [], // slides array [ { href:'...', title:'...' }, ...],
|
||||
$elem,
|
||||
selector = elem.selector,
|
||||
$selector = $( selector ),
|
||||
isMobile = navigator.userAgent.match( /(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i ),
|
||||
isTouch = isMobile !== null || document.createTouch !== undefined || ( 'ontouchstart' in window ) || ( 'onmsgesturechange' in window ) || navigator.msMaxTouchPoints,
|
||||
supportSVG = !! document.createElementNS && !! document.createElementNS( 'http://www.w3.org/2000/svg', 'svg').createSVGRect,
|
||||
winWidth = window.innerWidth ? window.innerWidth : $( window ).width(),
|
||||
winHeight = window.innerHeight ? window.innerHeight : $( window ).height(),
|
||||
currentX = 0,
|
||||
/* jshint multistr: true */
|
||||
html = '<div id="swipebox-overlay">\
|
||||
<div id="swipebox-container">\
|
||||
<div id="swipebox-slider"></div>\
|
||||
<div id="swipebox-top-bar">\
|
||||
<div id="swipebox-title"></div>\
|
||||
</div>\
|
||||
<div id="swipebox-bottom-bar">\
|
||||
<div id="swipebox-arrows">\
|
||||
<a id="swipebox-prev"></a>\
|
||||
<a id="swipebox-next"></a>\
|
||||
</div>\
|
||||
</div>\
|
||||
<a id="swipebox-close"></a>\
|
||||
</div>\
|
||||
</div>';
|
||||
|
||||
plugin.settings = {};
|
||||
|
||||
$.swipebox.close = function () {
|
||||
ui.closeSlide();
|
||||
};
|
||||
|
||||
$.swipebox.extend = function () {
|
||||
return ui;
|
||||
};
|
||||
|
||||
plugin.init = function() {
|
||||
|
||||
plugin.settings = $.extend( {}, defaults, options );
|
||||
|
||||
if ( $.isArray( elem ) ) {
|
||||
|
||||
elements = elem;
|
||||
ui.target = $( window );
|
||||
ui.init( plugin.settings.initialIndexOnArray );
|
||||
|
||||
} else {
|
||||
|
||||
$( document ).on( 'click', selector, function( event ) {
|
||||
|
||||
// console.log( isTouch );
|
||||
|
||||
if ( event.target.parentNode.className === 'slide current' ) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $.isArray( elem ) ) {
|
||||
ui.destroy();
|
||||
$elem = $( selector );
|
||||
ui.actions();
|
||||
}
|
||||
|
||||
elements = [];
|
||||
var index , relType, relVal;
|
||||
|
||||
// Allow for HTML5 compliant attribute before legacy use of rel
|
||||
if ( ! relVal ) {
|
||||
relType = 'data-rel';
|
||||
relVal = $( this ).attr( relType );
|
||||
}
|
||||
|
||||
if ( ! relVal ) {
|
||||
relType = 'rel';
|
||||
relVal = $( this ).attr( relType );
|
||||
}
|
||||
|
||||
if ( relVal && relVal !== '' && relVal !== 'nofollow' ) {
|
||||
$elem = $selector.filter( '[' + relType + '="' + relVal + '"]' );
|
||||
} else {
|
||||
$elem = $( selector );
|
||||
}
|
||||
|
||||
$elem.each( function() {
|
||||
|
||||
var title = null,
|
||||
href = null;
|
||||
|
||||
if ( $( this ).attr( 'title' ) ) {
|
||||
title = $( this ).attr( 'title' );
|
||||
}
|
||||
|
||||
|
||||
if ( $( this ).attr( 'href' ) ) {
|
||||
href = $( this ).attr( 'href' );
|
||||
}
|
||||
|
||||
elements.push( {
|
||||
href: href,
|
||||
title: title
|
||||
} );
|
||||
} );
|
||||
|
||||
index = $elem.index( $( this ) );
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
ui.target = $( event.target );
|
||||
ui.init( index );
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
ui = {
|
||||
|
||||
/**
|
||||
* Initiate Swipebox
|
||||
*/
|
||||
init : function( index ) {
|
||||
if ( plugin.settings.beforeOpen ) {
|
||||
plugin.settings.beforeOpen();
|
||||
}
|
||||
this.target.trigger( 'swipebox-start' );
|
||||
$.swipebox.isOpen = true;
|
||||
this.build();
|
||||
this.openSlide( index );
|
||||
this.openMedia( index );
|
||||
this.preloadMedia( index+1 );
|
||||
this.preloadMedia( index-1 );
|
||||
if ( plugin.settings.afterOpen ) {
|
||||
plugin.settings.afterOpen();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Built HTML containers and fire main functions
|
||||
*/
|
||||
build : function () {
|
||||
var $this = this, bg;
|
||||
|
||||
$( 'body' ).append( html );
|
||||
|
||||
if ( supportSVG && plugin.settings.useSVG === true ) {
|
||||
bg = $( '#swipebox-close' ).css( 'background-image' );
|
||||
bg = bg.replace( 'png', 'svg' );
|
||||
$( '#swipebox-prev, #swipebox-next, #swipebox-close' ).css( {
|
||||
'background-image' : bg
|
||||
} );
|
||||
}
|
||||
|
||||
if ( isMobile ) {
|
||||
$( '#swipebox-bottom-bar, #swipebox-top-bar' ).remove();
|
||||
}
|
||||
|
||||
$.each( elements, function() {
|
||||
$( '#swipebox-slider' ).append( '<div class="slide"></div>' );
|
||||
} );
|
||||
|
||||
$this.setDim();
|
||||
$this.actions();
|
||||
|
||||
if ( isTouch ) {
|
||||
$this.gesture();
|
||||
}
|
||||
|
||||
// Devices can have both touch and keyboard input so always allow key events
|
||||
$this.keyboard();
|
||||
|
||||
$this.animBars();
|
||||
$this.resize();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Set dimensions depending on windows width and height
|
||||
*/
|
||||
setDim : function () {
|
||||
|
||||
var width, height, sliderCss = {};
|
||||
|
||||
// Reset dimensions on mobile orientation change
|
||||
if ( 'onorientationchange' in window ) {
|
||||
|
||||
window.addEventListener( 'orientationchange', function() {
|
||||
if ( window.orientation === 0 ) {
|
||||
width = winWidth;
|
||||
height = winHeight;
|
||||
} else if ( window.orientation === 90 || window.orientation === -90 ) {
|
||||
width = winHeight;
|
||||
height = winWidth;
|
||||
}
|
||||
}, false );
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
width = window.innerWidth ? window.innerWidth : $( window ).width();
|
||||
height = window.innerHeight ? window.innerHeight : $( window ).height();
|
||||
}
|
||||
|
||||
sliderCss = {
|
||||
width : width,
|
||||
height : height
|
||||
};
|
||||
|
||||
$( '#swipebox-overlay' ).css( sliderCss );
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Reset dimensions on window resize envent
|
||||
*/
|
||||
resize : function () {
|
||||
var $this = this;
|
||||
|
||||
$( window ).resize( function() {
|
||||
$this.setDim();
|
||||
} ).resize();
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if device supports CSS transitions
|
||||
*/
|
||||
supportTransition : function () {
|
||||
|
||||
var prefixes = 'transition WebkitTransition MozTransition OTransition msTransition KhtmlTransition'.split( ' ' ),
|
||||
i;
|
||||
|
||||
for ( i = 0; i < prefixes.length; i++ ) {
|
||||
if ( document.createElement( 'div' ).style[ prefixes[i] ] !== undefined ) {
|
||||
return prefixes[i];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if CSS transitions are allowed (options + devicesupport)
|
||||
*/
|
||||
doCssTrans : function () {
|
||||
if ( plugin.settings.useCSS && this.supportTransition() ) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Touch navigation
|
||||
*/
|
||||
gesture : function () {
|
||||
|
||||
var $this = this,
|
||||
index,
|
||||
hDistance,
|
||||
vDistance,
|
||||
hDistanceLast,
|
||||
vDistanceLast,
|
||||
hDistancePercent,
|
||||
vSwipe = false,
|
||||
hSwipe = false,
|
||||
hSwipMinDistance = 10,
|
||||
vSwipMinDistance = 50,
|
||||
startCoords = {},
|
||||
endCoords = {},
|
||||
bars = $( '#swipebox-top-bar, #swipebox-bottom-bar' ),
|
||||
slider = $( '#swipebox-slider' );
|
||||
|
||||
bars.addClass( 'visible-bars' );
|
||||
$this.setTimeout();
|
||||
|
||||
$( 'body' ).bind( 'touchstart', function( event ) {
|
||||
|
||||
$( this ).addClass( 'touching' );
|
||||
index = $( '#swipebox-slider .slide' ).index( $( '#swipebox-slider .slide.current' ) );
|
||||
endCoords = event.originalEvent.targetTouches[0];
|
||||
startCoords.pageX = event.originalEvent.targetTouches[0].pageX;
|
||||
startCoords.pageY = event.originalEvent.targetTouches[0].pageY;
|
||||
|
||||
$( '#swipebox-slider' ).css( {
|
||||
'-webkit-transform' : 'translate3d(' + currentX +'%, 0, 0)',
|
||||
'transform' : 'translate3d(' + currentX + '%, 0, 0)'
|
||||
} );
|
||||
|
||||
$( '.touching' ).bind( 'touchmove',function( event ) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
endCoords = event.originalEvent.targetTouches[0];
|
||||
|
||||
if ( ! hSwipe ) {
|
||||
vDistanceLast = vDistance;
|
||||
vDistance = endCoords.pageY - startCoords.pageY;
|
||||
if ( Math.abs( vDistance ) >= vSwipMinDistance || vSwipe ) {
|
||||
var opacity = 0.75 - Math.abs(vDistance) / slider.height();
|
||||
|
||||
slider.css( { 'top': vDistance + 'px' } );
|
||||
slider.css( { 'opacity': opacity } );
|
||||
|
||||
vSwipe = true;
|
||||
}
|
||||
}
|
||||
|
||||
hDistanceLast = hDistance;
|
||||
hDistance = endCoords.pageX - startCoords.pageX;
|
||||
hDistancePercent = hDistance * 100 / winWidth;
|
||||
|
||||
if ( ! hSwipe && ! vSwipe && Math.abs( hDistance ) >= hSwipMinDistance ) {
|
||||
$( '#swipebox-slider' ).css( {
|
||||
'-webkit-transition' : '',
|
||||
'transition' : ''
|
||||
} );
|
||||
hSwipe = true;
|
||||
}
|
||||
|
||||
if ( hSwipe ) {
|
||||
|
||||
// swipe left
|
||||
if ( 0 < hDistance ) {
|
||||
|
||||
// first slide
|
||||
if ( 0 === index ) {
|
||||
// console.log( 'first' );
|
||||
$( '#swipebox-overlay' ).addClass( 'leftSpringTouch' );
|
||||
} else {
|
||||
// Follow gesture
|
||||
$( '#swipebox-overlay' ).removeClass( 'leftSpringTouch' ).removeClass( 'rightSpringTouch' );
|
||||
$( '#swipebox-slider' ).css( {
|
||||
'-webkit-transform' : 'translate3d(' + ( currentX + hDistancePercent ) +'%, 0, 0)',
|
||||
'transform' : 'translate3d(' + ( currentX + hDistancePercent ) + '%, 0, 0)'
|
||||
} );
|
||||
}
|
||||
|
||||
// swipe rught
|
||||
} else if ( 0 > hDistance ) {
|
||||
|
||||
// last Slide
|
||||
if ( elements.length === index +1 ) {
|
||||
// console.log( 'last' );
|
||||
$( '#swipebox-overlay' ).addClass( 'rightSpringTouch' );
|
||||
} else {
|
||||
$( '#swipebox-overlay' ).removeClass( 'leftSpringTouch' ).removeClass( 'rightSpringTouch' );
|
||||
$( '#swipebox-slider' ).css( {
|
||||
'-webkit-transform' : 'translate3d(' + ( currentX + hDistancePercent ) +'%, 0, 0)',
|
||||
'transform' : 'translate3d(' + ( currentX + hDistancePercent ) + '%, 0, 0)'
|
||||
} );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
return false;
|
||||
|
||||
} ).bind( 'touchend',function( event ) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
$( '#swipebox-slider' ).css( {
|
||||
'-webkit-transition' : '-webkit-transform 0.4s ease',
|
||||
'transition' : 'transform 0.4s ease'
|
||||
} );
|
||||
|
||||
vDistance = endCoords.pageY - startCoords.pageY;
|
||||
hDistance = endCoords.pageX - startCoords.pageX;
|
||||
hDistancePercent = hDistance*100/winWidth;
|
||||
|
||||
// Swipe to bottom to close
|
||||
if ( vSwipe ) {
|
||||
vSwipe = false;
|
||||
if ( Math.abs( vDistance ) >= 2 * vSwipMinDistance && Math.abs( vDistance ) > Math.abs( vDistanceLast ) ) {
|
||||
var vOffset = vDistance > 0 ? slider.height() : - slider.height();
|
||||
slider.animate( { top: vOffset + 'px', 'opacity': 0 },
|
||||
300,
|
||||
function () {
|
||||
$this.closeSlide();
|
||||
} );
|
||||
} else {
|
||||
slider.animate( { top: 0, 'opacity': 1 }, 300 );
|
||||
}
|
||||
|
||||
} else if ( hSwipe ) {
|
||||
|
||||
hSwipe = false;
|
||||
|
||||
// swipeLeft
|
||||
if( hDistance >= hSwipMinDistance && hDistance >= hDistanceLast) {
|
||||
|
||||
$this.getPrev();
|
||||
|
||||
// swipeRight
|
||||
} else if ( hDistance <= -hSwipMinDistance && hDistance <= hDistanceLast) {
|
||||
|
||||
$this.getNext();
|
||||
}
|
||||
|
||||
} else { // Top and bottom bars have been removed on touchable devices
|
||||
// tap
|
||||
if ( ! bars.hasClass( 'visible-bars' ) ) {
|
||||
$this.showBars();
|
||||
$this.setTimeout();
|
||||
} else {
|
||||
$this.clearTimeout();
|
||||
$this.hideBars();
|
||||
}
|
||||
}
|
||||
|
||||
$( '#swipebox-slider' ).css( {
|
||||
'-webkit-transform' : 'translate3d(' + currentX + '%, 0, 0)',
|
||||
'transform' : 'translate3d(' + currentX + '%, 0, 0)'
|
||||
} );
|
||||
|
||||
$( '#swipebox-overlay' ).removeClass( 'leftSpringTouch' ).removeClass( 'rightSpringTouch' );
|
||||
$( '.touching' ).off( 'touchmove' ).removeClass( 'touching' );
|
||||
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Set timer to hide the action bars
|
||||
*/
|
||||
setTimeout: function () {
|
||||
if ( plugin.settings.hideBarsDelay > 0 ) {
|
||||
var $this = this;
|
||||
$this.clearTimeout();
|
||||
$this.timeout = window.setTimeout( function() {
|
||||
$this.hideBars();
|
||||
},
|
||||
|
||||
plugin.settings.hideBarsDelay
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Clear timer
|
||||
*/
|
||||
clearTimeout: function () {
|
||||
window.clearTimeout( this.timeout );
|
||||
this.timeout = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Show navigation and title bars
|
||||
*/
|
||||
showBars : function () {
|
||||
var bars = $( '#swipebox-top-bar, #swipebox-bottom-bar' );
|
||||
if ( this.doCssTrans() ) {
|
||||
bars.addClass( 'visible-bars' );
|
||||
} else {
|
||||
$( '#swipebox-top-bar' ).animate( { top : 0 }, 500 );
|
||||
$( '#swipebox-bottom-bar' ).animate( { bottom : 0 }, 500 );
|
||||
setTimeout( function() {
|
||||
bars.addClass( 'visible-bars' );
|
||||
}, 1000 );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Hide navigation and title bars
|
||||
*/
|
||||
hideBars : function () {
|
||||
var bars = $( '#swipebox-top-bar, #swipebox-bottom-bar' );
|
||||
if ( this.doCssTrans() ) {
|
||||
bars.removeClass( 'visible-bars' );
|
||||
} else {
|
||||
$( '#swipebox-top-bar' ).animate( { top : '-50px' }, 500 );
|
||||
$( '#swipebox-bottom-bar' ).animate( { bottom : '-50px' }, 500 );
|
||||
setTimeout( function() {
|
||||
bars.removeClass( 'visible-bars' );
|
||||
}, 1000 );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Animate navigation and top bars
|
||||
*/
|
||||
animBars : function () {
|
||||
var $this = this,
|
||||
bars = $( '#swipebox-top-bar, #swipebox-bottom-bar' );
|
||||
|
||||
bars.addClass( 'visible-bars' );
|
||||
$this.setTimeout();
|
||||
|
||||
$( '#swipebox-slider' ).click( function() {
|
||||
if ( ! bars.hasClass( 'visible-bars' ) ) {
|
||||
$this.showBars();
|
||||
$this.setTimeout();
|
||||
}
|
||||
} );
|
||||
|
||||
$( '#swipebox-bottom-bar' ).hover( function() {
|
||||
$this.showBars();
|
||||
bars.addClass( 'visible-bars' );
|
||||
$this.clearTimeout();
|
||||
|
||||
}, function() {
|
||||
if ( plugin.settings.hideBarsDelay > 0 ) {
|
||||
bars.removeClass( 'visible-bars' );
|
||||
$this.setTimeout();
|
||||
}
|
||||
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Keyboard navigation
|
||||
*/
|
||||
keyboard : function () {
|
||||
var $this = this;
|
||||
$( window ).bind( 'keyup', function( event ) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
if ( event.keyCode === 37 ) {
|
||||
|
||||
$this.getPrev();
|
||||
|
||||
} else if ( event.keyCode === 39 ) {
|
||||
|
||||
$this.getNext();
|
||||
|
||||
} else if ( event.keyCode === 27 ) {
|
||||
|
||||
$this.closeSlide();
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Navigation events : go to next slide, go to prevous slide and close
|
||||
*/
|
||||
actions : function () {
|
||||
var $this = this,
|
||||
action = 'touchend click'; // Just detect for both event types to allow for multi-input
|
||||
|
||||
if ( elements.length < 2 ) {
|
||||
|
||||
$( '#swipebox-bottom-bar' ).hide();
|
||||
|
||||
if ( undefined === elements[ 1 ] ) {
|
||||
$( '#swipebox-top-bar' ).hide();
|
||||
}
|
||||
|
||||
} else {
|
||||
$( '#swipebox-prev' ).bind( action, function( event ) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
$this.getPrev();
|
||||
$this.setTimeout();
|
||||
} );
|
||||
|
||||
$( '#swipebox-next' ).bind( action, function( event ) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
$this.getNext();
|
||||
$this.setTimeout();
|
||||
} );
|
||||
}
|
||||
|
||||
$( '#swipebox-close' ).bind( action, function() {
|
||||
$this.closeSlide();
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Set current slide
|
||||
*/
|
||||
setSlide : function ( index, isFirst ) {
|
||||
|
||||
isFirst = isFirst || false;
|
||||
|
||||
var slider = $( '#swipebox-slider' );
|
||||
|
||||
currentX = -index*100;
|
||||
|
||||
if ( this.doCssTrans() ) {
|
||||
slider.css( {
|
||||
'-webkit-transform' : 'translate3d(' + (-index*100)+'%, 0, 0)',
|
||||
'transform' : 'translate3d(' + (-index*100)+'%, 0, 0)'
|
||||
} );
|
||||
} else {
|
||||
slider.animate( { left : ( -index*100 )+'%' } );
|
||||
}
|
||||
|
||||
$( '#swipebox-slider .slide' ).removeClass( 'current' );
|
||||
$( '#swipebox-slider .slide' ).eq( index ).addClass( 'current' );
|
||||
this.setTitle( index );
|
||||
|
||||
if ( isFirst ) {
|
||||
slider.fadeIn();
|
||||
}
|
||||
|
||||
$( '#swipebox-prev, #swipebox-next' ).removeClass( 'disabled' );
|
||||
|
||||
if ( index === 0 ) {
|
||||
$( '#swipebox-prev' ).addClass( 'disabled' );
|
||||
} else if ( index === elements.length - 1 && plugin.settings.loopAtEnd !== true ) {
|
||||
$( '#swipebox-next' ).addClass( 'disabled' );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Open slide
|
||||
*/
|
||||
openSlide : function ( index ) {
|
||||
$( 'html' ).addClass( 'swipebox-html' );
|
||||
if ( isTouch ) {
|
||||
$( 'html' ).addClass( 'swipebox-touch' );
|
||||
|
||||
if ( plugin.settings.hideCloseButtonOnMobile ) {
|
||||
$( 'html' ).addClass( 'swipebox-no-close-button' );
|
||||
}
|
||||
} else {
|
||||
$( 'html' ).addClass( 'swipebox-no-touch' );
|
||||
}
|
||||
$( window ).trigger( 'resize' ); // fix scroll bar visibility on desktop
|
||||
this.setSlide( index, true );
|
||||
},
|
||||
|
||||
/**
|
||||
* Set a time out if the media is a video
|
||||
*/
|
||||
preloadMedia : function ( index ) {
|
||||
var $this = this,
|
||||
src = null;
|
||||
|
||||
if ( elements[ index ] !== undefined ) {
|
||||
src = elements[ index ].href;
|
||||
}
|
||||
|
||||
if ( ! $this.isVideo( src ) ) {
|
||||
setTimeout( function() {
|
||||
$this.openMedia( index );
|
||||
}, 1000);
|
||||
} else {
|
||||
$this.openMedia( index );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Open
|
||||
*/
|
||||
openMedia : function ( index ) {
|
||||
var $this = this,
|
||||
src,
|
||||
slide;
|
||||
|
||||
if ( elements[ index ] !== undefined ) {
|
||||
src = elements[ index ].href;
|
||||
}
|
||||
|
||||
if ( index < 0 || index >= elements.length ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
slide = $( '#swipebox-slider .slide' ).eq( index );
|
||||
|
||||
if ( ! $this.isVideo( src ) ) {
|
||||
slide.addClass( 'slide-loading' );
|
||||
$this.loadMedia( src, function() {
|
||||
slide.removeClass( 'slide-loading' );
|
||||
slide.html( this );
|
||||
} );
|
||||
} else {
|
||||
slide.html( $this.getVideo( src ) );
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Set link title attribute as caption
|
||||
*/
|
||||
setTitle : function ( index ) {
|
||||
var title = null;
|
||||
|
||||
$( '#swipebox-title' ).empty();
|
||||
|
||||
if ( elements[ index ] !== undefined ) {
|
||||
title = elements[ index ].title;
|
||||
}
|
||||
|
||||
if ( title ) {
|
||||
$( '#swipebox-top-bar' ).show();
|
||||
$( '#swipebox-title' ).append( title );
|
||||
} else {
|
||||
$( '#swipebox-top-bar' ).hide();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if the URL is a video
|
||||
*/
|
||||
isVideo : function ( src ) {
|
||||
|
||||
if ( src ) {
|
||||
if ( src.match( /youtube\.com\/watch\?v=([a-zA-Z0-9\-_]+)/) || src.match( /vimeo\.com\/([0-9]*)/ ) || src.match( /youtu\.be\/([a-zA-Z0-9\-_]+)/ ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( src.toLowerCase().indexOf( 'swipeboxvideo=1' ) >= 0 ) {
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Get video iframe code from URL
|
||||
*/
|
||||
getVideo : function( url ) {
|
||||
var iframe = '',
|
||||
youtubeUrl = url.match( /watch\?v=([a-zA-Z0-9\-_]+)/ ),
|
||||
youtubeShortUrl = url.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/),
|
||||
vimeoUrl = url.match( /vimeo\.com\/([0-9]*)/ );
|
||||
if ( youtubeUrl || youtubeShortUrl) {
|
||||
if ( youtubeShortUrl ) {
|
||||
youtubeUrl = youtubeShortUrl;
|
||||
}
|
||||
iframe = '<iframe width="560" height="315" src="//www.youtube.com/embed/' + youtubeUrl[1] + '?autoplay='+ plugin.settings.autoplayVideos + '" frameborder="0" allowfullscreen></iframe>';
|
||||
|
||||
} else if ( vimeoUrl ) {
|
||||
|
||||
iframe = '<iframe width="560" height="315" src="//player.vimeo.com/video/' + vimeoUrl[1] + '?byline=0&portrait=0&color=' + plugin.settings.vimeoColor + '&autoplay=' + plugin.settings.autoplayVideos + '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
|
||||
|
||||
}
|
||||
|
||||
if ( youtubeUrl || youtubeShortUrl || vimeoUrl ) {
|
||||
|
||||
} else {
|
||||
iframe = '<iframe width="560" height="315" src="' + url + '" frameborder="0" allowfullscreen></iframe>';
|
||||
}
|
||||
|
||||
return '<div class="swipebox-video-container" style="max-width:' + plugin.settings.videomaxWidth + 'px"><div class="swipebox-video">' + iframe + '</div></div>';
|
||||
},
|
||||
|
||||
/**
|
||||
* Load image
|
||||
*/
|
||||
loadMedia : function ( src, callback ) {
|
||||
if ( ! this.isVideo( src ) ) {
|
||||
var img = $( '<img>' ).on( 'load', function() {
|
||||
callback.call( img );
|
||||
} );
|
||||
|
||||
img.attr( 'src', src );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Get next slide
|
||||
*/
|
||||
getNext : function () {
|
||||
var $this = this,
|
||||
src,
|
||||
index = $( '#swipebox-slider .slide' ).index( $( '#swipebox-slider .slide.current' ) );
|
||||
if ( index + 1 < elements.length ) {
|
||||
|
||||
src = $( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe' ).attr( 'src' );
|
||||
$( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe' ).attr( 'src', src );
|
||||
index++;
|
||||
$this.setSlide( index );
|
||||
$this.preloadMedia( index+1 );
|
||||
} else {
|
||||
|
||||
if ( plugin.settings.loopAtEnd === true ) {
|
||||
src = $( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe' ).attr( 'src' );
|
||||
$( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe' ).attr( 'src', src );
|
||||
index = 0;
|
||||
$this.preloadMedia( index );
|
||||
$this.setSlide( index );
|
||||
$this.preloadMedia( index + 1 );
|
||||
} else {
|
||||
$( '#swipebox-overlay' ).addClass( 'rightSpring' );
|
||||
setTimeout( function() {
|
||||
$( '#swipebox-overlay' ).removeClass( 'rightSpring' );
|
||||
}, 500 );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Get previous slide
|
||||
*/
|
||||
getPrev : function () {
|
||||
var index = $( '#swipebox-slider .slide' ).index( $( '#swipebox-slider .slide.current' ) ),
|
||||
src;
|
||||
if ( index > 0 ) {
|
||||
src = $( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe').attr( 'src' );
|
||||
$( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe' ).attr( 'src', src );
|
||||
index--;
|
||||
this.setSlide( index );
|
||||
this.preloadMedia( index-1 );
|
||||
} else {
|
||||
$( '#swipebox-overlay' ).addClass( 'leftSpring' );
|
||||
setTimeout( function() {
|
||||
$( '#swipebox-overlay' ).removeClass( 'leftSpring' );
|
||||
}, 500 );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Close
|
||||
*/
|
||||
closeSlide : function () {
|
||||
$( 'html' ).removeClass( 'swipebox-html' );
|
||||
$( 'html' ).removeClass( 'swipebox-touch' );
|
||||
$( window ).trigger( 'resize' );
|
||||
this.destroy();
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroy the whole thing
|
||||
*/
|
||||
destroy : function () {
|
||||
$( window ).unbind( 'keyup' );
|
||||
$( 'body' ).unbind( 'touchstart' );
|
||||
$( 'body' ).unbind( 'touchmove' );
|
||||
$( 'body' ).unbind( 'touchend' );
|
||||
$( '#swipebox-slider' ).unbind();
|
||||
$( '#swipebox-overlay' ).remove();
|
||||
|
||||
if ( ! $.isArray( elem ) ) {
|
||||
elem.removeData( '_swipebox' );
|
||||
}
|
||||
|
||||
if ( this.target ) {
|
||||
this.target.trigger( 'swipebox-destroy' );
|
||||
}
|
||||
|
||||
$.swipebox.isOpen = false;
|
||||
|
||||
if ( plugin.settings.afterClose ) {
|
||||
plugin.settings.afterClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
plugin.init();
|
||||
};
|
||||
|
||||
$.fn.swipebox = function( options ) {
|
||||
|
||||
if ( ! $.data( this, '_swipebox' ) ) {
|
||||
var swipebox = new $.swipebox( this, options );
|
||||
this.data( '_swipebox', swipebox );
|
||||
}
|
||||
return this.data( '_swipebox' );
|
||||
|
||||
};
|
||||
|
||||
}( window, document, jQuery ) );
|
|
@ -1,956 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
* Code distributed by Google as part of the polymer project is also
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
// @version 0.7.3
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
var counter = Date.now() % 1e9;
|
||||
var WeakMap = function() {
|
||||
this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__");
|
||||
};
|
||||
WeakMap.prototype = {
|
||||
set: function(key, value) {
|
||||
var entry = key[this.name];
|
||||
if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {
|
||||
value: [ key, value ],
|
||||
writable: true
|
||||
});
|
||||
return this;
|
||||
},
|
||||
get: function(key) {
|
||||
var entry;
|
||||
return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
|
||||
},
|
||||
"delete": function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry || entry[0] !== key) return false;
|
||||
entry[0] = entry[1] = undefined;
|
||||
return true;
|
||||
},
|
||||
has: function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry) return false;
|
||||
return entry[0] === key;
|
||||
}
|
||||
};
|
||||
window.WeakMap = WeakMap;
|
||||
})();
|
||||
}
|
||||
|
||||
(function(global) {
|
||||
var registrationsTable = new WeakMap();
|
||||
var setImmediate;
|
||||
if (/Trident|Edge/.test(navigator.userAgent)) {
|
||||
setImmediate = setTimeout;
|
||||
} else if (window.setImmediate) {
|
||||
setImmediate = window.setImmediate;
|
||||
} else {
|
||||
var setImmediateQueue = [];
|
||||
var sentinel = String(Math.random());
|
||||
window.addEventListener("message", function(e) {
|
||||
if (e.data === sentinel) {
|
||||
var queue = setImmediateQueue;
|
||||
setImmediateQueue = [];
|
||||
queue.forEach(function(func) {
|
||||
func();
|
||||
});
|
||||
}
|
||||
});
|
||||
setImmediate = function(func) {
|
||||
setImmediateQueue.push(func);
|
||||
window.postMessage(sentinel, "*");
|
||||
};
|
||||
}
|
||||
var isScheduled = false;
|
||||
var scheduledObservers = [];
|
||||
function scheduleCallback(observer) {
|
||||
scheduledObservers.push(observer);
|
||||
if (!isScheduled) {
|
||||
isScheduled = true;
|
||||
setImmediate(dispatchCallbacks);
|
||||
}
|
||||
}
|
||||
function wrapIfNeeded(node) {
|
||||
return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;
|
||||
}
|
||||
function dispatchCallbacks() {
|
||||
isScheduled = false;
|
||||
var observers = scheduledObservers;
|
||||
scheduledObservers = [];
|
||||
observers.sort(function(o1, o2) {
|
||||
return o1.uid_ - o2.uid_;
|
||||
});
|
||||
var anyNonEmpty = false;
|
||||
observers.forEach(function(observer) {
|
||||
var queue = observer.takeRecords();
|
||||
removeTransientObserversFor(observer);
|
||||
if (queue.length) {
|
||||
observer.callback_(queue, observer);
|
||||
anyNonEmpty = true;
|
||||
}
|
||||
});
|
||||
if (anyNonEmpty) dispatchCallbacks();
|
||||
}
|
||||
function removeTransientObserversFor(observer) {
|
||||
observer.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) return;
|
||||
registrations.forEach(function(registration) {
|
||||
if (registration.observer === observer) registration.removeTransientObservers();
|
||||
});
|
||||
});
|
||||
}
|
||||
function forEachAncestorAndObserverEnqueueRecord(target, callback) {
|
||||
for (var node = target; node; node = node.parentNode) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (registrations) {
|
||||
for (var j = 0; j < registrations.length; j++) {
|
||||
var registration = registrations[j];
|
||||
var options = registration.options;
|
||||
if (node !== target && !options.subtree) continue;
|
||||
var record = callback(options);
|
||||
if (record) registration.enqueue(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var uidCounter = 0;
|
||||
function JsMutationObserver(callback) {
|
||||
this.callback_ = callback;
|
||||
this.nodes_ = [];
|
||||
this.records_ = [];
|
||||
this.uid_ = ++uidCounter;
|
||||
}
|
||||
JsMutationObserver.prototype = {
|
||||
observe: function(target, options) {
|
||||
target = wrapIfNeeded(target);
|
||||
if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
|
||||
throw new SyntaxError();
|
||||
}
|
||||
var registrations = registrationsTable.get(target);
|
||||
if (!registrations) registrationsTable.set(target, registrations = []);
|
||||
var registration;
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i].observer === this) {
|
||||
registration = registrations[i];
|
||||
registration.removeListeners();
|
||||
registration.options = options;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!registration) {
|
||||
registration = new Registration(this, target, options);
|
||||
registrations.push(registration);
|
||||
this.nodes_.push(target);
|
||||
}
|
||||
registration.addListeners();
|
||||
},
|
||||
disconnect: function() {
|
||||
this.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
var registration = registrations[i];
|
||||
if (registration.observer === this) {
|
||||
registration.removeListeners();
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
this.records_ = [];
|
||||
},
|
||||
takeRecords: function() {
|
||||
var copyOfRecords = this.records_;
|
||||
this.records_ = [];
|
||||
return copyOfRecords;
|
||||
}
|
||||
};
|
||||
function MutationRecord(type, target) {
|
||||
this.type = type;
|
||||
this.target = target;
|
||||
this.addedNodes = [];
|
||||
this.removedNodes = [];
|
||||
this.previousSibling = null;
|
||||
this.nextSibling = null;
|
||||
this.attributeName = null;
|
||||
this.attributeNamespace = null;
|
||||
this.oldValue = null;
|
||||
}
|
||||
function copyMutationRecord(original) {
|
||||
var record = new MutationRecord(original.type, original.target);
|
||||
record.addedNodes = original.addedNodes.slice();
|
||||
record.removedNodes = original.removedNodes.slice();
|
||||
record.previousSibling = original.previousSibling;
|
||||
record.nextSibling = original.nextSibling;
|
||||
record.attributeName = original.attributeName;
|
||||
record.attributeNamespace = original.attributeNamespace;
|
||||
record.oldValue = original.oldValue;
|
||||
return record;
|
||||
}
|
||||
var currentRecord, recordWithOldValue;
|
||||
function getRecord(type, target) {
|
||||
return currentRecord = new MutationRecord(type, target);
|
||||
}
|
||||
function getRecordWithOldValue(oldValue) {
|
||||
if (recordWithOldValue) return recordWithOldValue;
|
||||
recordWithOldValue = copyMutationRecord(currentRecord);
|
||||
recordWithOldValue.oldValue = oldValue;
|
||||
return recordWithOldValue;
|
||||
}
|
||||
function clearRecords() {
|
||||
currentRecord = recordWithOldValue = undefined;
|
||||
}
|
||||
function recordRepresentsCurrentMutation(record) {
|
||||
return record === recordWithOldValue || record === currentRecord;
|
||||
}
|
||||
function selectRecord(lastRecord, newRecord) {
|
||||
if (lastRecord === newRecord) return lastRecord;
|
||||
if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue;
|
||||
return null;
|
||||
}
|
||||
function Registration(observer, target, options) {
|
||||
this.observer = observer;
|
||||
this.target = target;
|
||||
this.options = options;
|
||||
this.transientObservedNodes = [];
|
||||
}
|
||||
Registration.prototype = {
|
||||
enqueue: function(record) {
|
||||
var records = this.observer.records_;
|
||||
var length = records.length;
|
||||
if (records.length > 0) {
|
||||
var lastRecord = records[length - 1];
|
||||
var recordToReplaceLast = selectRecord(lastRecord, record);
|
||||
if (recordToReplaceLast) {
|
||||
records[length - 1] = recordToReplaceLast;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
scheduleCallback(this.observer);
|
||||
}
|
||||
records[length] = record;
|
||||
},
|
||||
addListeners: function() {
|
||||
this.addListeners_(this.target);
|
||||
},
|
||||
addListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.addEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.addEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
removeListeners: function() {
|
||||
this.removeListeners_(this.target);
|
||||
},
|
||||
removeListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.removeEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.removeEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
addTransientObserver: function(node) {
|
||||
if (node === this.target) return;
|
||||
this.addListeners_(node);
|
||||
this.transientObservedNodes.push(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) registrationsTable.set(node, registrations = []);
|
||||
registrations.push(this);
|
||||
},
|
||||
removeTransientObservers: function() {
|
||||
var transientObservedNodes = this.transientObservedNodes;
|
||||
this.transientObservedNodes = [];
|
||||
transientObservedNodes.forEach(function(node) {
|
||||
this.removeListeners_(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i] === this) {
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
handleEvent: function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
switch (e.type) {
|
||||
case "DOMAttrModified":
|
||||
var name = e.attrName;
|
||||
var namespace = e.relatedNode.namespaceURI;
|
||||
var target = e.target;
|
||||
var record = new getRecord("attributes", target);
|
||||
record.attributeName = name;
|
||||
record.attributeNamespace = namespace;
|
||||
var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.attributes) return;
|
||||
if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {
|
||||
return;
|
||||
}
|
||||
if (options.attributeOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMCharacterDataModified":
|
||||
var target = e.target;
|
||||
var record = getRecord("characterData", target);
|
||||
var oldValue = e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.characterData) return;
|
||||
if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMNodeRemoved":
|
||||
this.addTransientObserver(e.target);
|
||||
|
||||
case "DOMNodeInserted":
|
||||
var changedNode = e.target;
|
||||
var addedNodes, removedNodes;
|
||||
if (e.type === "DOMNodeInserted") {
|
||||
addedNodes = [ changedNode ];
|
||||
removedNodes = [];
|
||||
} else {
|
||||
addedNodes = [];
|
||||
removedNodes = [ changedNode ];
|
||||
}
|
||||
var previousSibling = changedNode.previousSibling;
|
||||
var nextSibling = changedNode.nextSibling;
|
||||
var record = getRecord("childList", e.target.parentNode);
|
||||
record.addedNodes = addedNodes;
|
||||
record.removedNodes = removedNodes;
|
||||
record.previousSibling = previousSibling;
|
||||
record.nextSibling = nextSibling;
|
||||
forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) {
|
||||
if (!options.childList) return;
|
||||
return record;
|
||||
});
|
||||
}
|
||||
clearRecords();
|
||||
}
|
||||
};
|
||||
global.JsMutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
|
||||
})(this);
|
||||
|
||||
window.CustomElements = window.CustomElements || {
|
||||
flags: {}
|
||||
};
|
||||
|
||||
(function(scope) {
|
||||
var flags = scope.flags;
|
||||
var modules = [];
|
||||
var addModule = function(module) {
|
||||
modules.push(module);
|
||||
};
|
||||
var initializeModules = function() {
|
||||
modules.forEach(function(module) {
|
||||
module(scope);
|
||||
});
|
||||
};
|
||||
scope.addModule = addModule;
|
||||
scope.initializeModules = initializeModules;
|
||||
scope.hasNative = Boolean(document.registerElement);
|
||||
scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || HTMLImports.useNative);
|
||||
})(window.CustomElements);
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var IMPORT_LINK_TYPE = window.HTMLImports ? HTMLImports.IMPORT_LINK_TYPE : "none";
|
||||
function forSubtree(node, cb) {
|
||||
findAllElements(node, function(e) {
|
||||
if (cb(e)) {
|
||||
return true;
|
||||
}
|
||||
forRoots(e, cb);
|
||||
});
|
||||
forRoots(node, cb);
|
||||
}
|
||||
function findAllElements(node, find, data) {
|
||||
var e = node.firstElementChild;
|
||||
if (!e) {
|
||||
e = node.firstChild;
|
||||
while (e && e.nodeType !== Node.ELEMENT_NODE) {
|
||||
e = e.nextSibling;
|
||||
}
|
||||
}
|
||||
while (e) {
|
||||
if (find(e, data) !== true) {
|
||||
findAllElements(e, find, data);
|
||||
}
|
||||
e = e.nextElementSibling;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function forRoots(node, cb) {
|
||||
var root = node.shadowRoot;
|
||||
while (root) {
|
||||
forSubtree(root, cb);
|
||||
root = root.olderShadowRoot;
|
||||
}
|
||||
}
|
||||
function forDocumentTree(doc, cb) {
|
||||
_forDocumentTree(doc, cb, []);
|
||||
}
|
||||
function _forDocumentTree(doc, cb, processingDocuments) {
|
||||
doc = wrap(doc);
|
||||
if (processingDocuments.indexOf(doc) >= 0) {
|
||||
return;
|
||||
}
|
||||
processingDocuments.push(doc);
|
||||
var imports = doc.querySelectorAll("link[rel=" + IMPORT_LINK_TYPE + "]");
|
||||
for (var i = 0, l = imports.length, n; i < l && (n = imports[i]); i++) {
|
||||
if (n.import) {
|
||||
_forDocumentTree(n.import, cb, processingDocuments);
|
||||
}
|
||||
}
|
||||
cb(doc);
|
||||
}
|
||||
scope.forDocumentTree = forDocumentTree;
|
||||
scope.forSubtree = forSubtree;
|
||||
});
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var flags = scope.flags;
|
||||
var forSubtree = scope.forSubtree;
|
||||
var forDocumentTree = scope.forDocumentTree;
|
||||
function addedNode(node) {
|
||||
return added(node) || addedSubtree(node);
|
||||
}
|
||||
function added(node) {
|
||||
if (scope.upgrade(node)) {
|
||||
return true;
|
||||
}
|
||||
attached(node);
|
||||
}
|
||||
function addedSubtree(node) {
|
||||
forSubtree(node, function(e) {
|
||||
if (added(e)) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
function attachedNode(node) {
|
||||
attached(node);
|
||||
if (inDocument(node)) {
|
||||
forSubtree(node, function(e) {
|
||||
attached(e);
|
||||
});
|
||||
}
|
||||
}
|
||||
var hasPolyfillMutations = !window.MutationObserver || window.MutationObserver === window.JsMutationObserver;
|
||||
scope.hasPolyfillMutations = hasPolyfillMutations;
|
||||
var isPendingMutations = false;
|
||||
var pendingMutations = [];
|
||||
function deferMutation(fn) {
|
||||
pendingMutations.push(fn);
|
||||
if (!isPendingMutations) {
|
||||
isPendingMutations = true;
|
||||
setTimeout(takeMutations);
|
||||
}
|
||||
}
|
||||
function takeMutations() {
|
||||
isPendingMutations = false;
|
||||
var $p = pendingMutations;
|
||||
for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {
|
||||
p();
|
||||
}
|
||||
pendingMutations = [];
|
||||
}
|
||||
function attached(element) {
|
||||
if (hasPolyfillMutations) {
|
||||
deferMutation(function() {
|
||||
_attached(element);
|
||||
});
|
||||
} else {
|
||||
_attached(element);
|
||||
}
|
||||
}
|
||||
function _attached(element) {
|
||||
if (element.__upgraded__ && (element.attachedCallback || element.detachedCallback)) {
|
||||
if (!element.__attached && inDocument(element)) {
|
||||
element.__attached = true;
|
||||
if (element.attachedCallback) {
|
||||
element.attachedCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function detachedNode(node) {
|
||||
detached(node);
|
||||
forSubtree(node, function(e) {
|
||||
detached(e);
|
||||
});
|
||||
}
|
||||
function detached(element) {
|
||||
if (hasPolyfillMutations) {
|
||||
deferMutation(function() {
|
||||
_detached(element);
|
||||
});
|
||||
} else {
|
||||
_detached(element);
|
||||
}
|
||||
}
|
||||
function _detached(element) {
|
||||
if (element.__upgraded__ && (element.attachedCallback || element.detachedCallback)) {
|
||||
if (element.__attached && !inDocument(element)) {
|
||||
element.__attached = false;
|
||||
if (element.detachedCallback) {
|
||||
element.detachedCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function inDocument(element) {
|
||||
var p = element;
|
||||
var doc = wrap(document);
|
||||
while (p) {
|
||||
if (p == doc) {
|
||||
return true;
|
||||
}
|
||||
p = p.parentNode || p.nodeType === Node.DOCUMENT_FRAGMENT_NODE && p.host;
|
||||
}
|
||||
}
|
||||
function watchShadow(node) {
|
||||
if (node.shadowRoot && !node.shadowRoot.__watched) {
|
||||
flags.dom && console.log("watching shadow-root for: ", node.localName);
|
||||
var root = node.shadowRoot;
|
||||
while (root) {
|
||||
observe(root);
|
||||
root = root.olderShadowRoot;
|
||||
}
|
||||
}
|
||||
}
|
||||
function handler(mutations) {
|
||||
if (flags.dom) {
|
||||
var mx = mutations[0];
|
||||
if (mx && mx.type === "childList" && mx.addedNodes) {
|
||||
if (mx.addedNodes) {
|
||||
var d = mx.addedNodes[0];
|
||||
while (d && d !== document && !d.host) {
|
||||
d = d.parentNode;
|
||||
}
|
||||
var u = d && (d.URL || d._URL || d.host && d.host.localName) || "";
|
||||
u = u.split("/?").shift().split("/").pop();
|
||||
}
|
||||
}
|
||||
console.group("mutations (%d) [%s]", mutations.length, u || "");
|
||||
}
|
||||
mutations.forEach(function(mx) {
|
||||
if (mx.type === "childList") {
|
||||
forEach(mx.addedNodes, function(n) {
|
||||
if (!n.localName) {
|
||||
return;
|
||||
}
|
||||
addedNode(n);
|
||||
});
|
||||
forEach(mx.removedNodes, function(n) {
|
||||
if (!n.localName) {
|
||||
return;
|
||||
}
|
||||
detachedNode(n);
|
||||
});
|
||||
}
|
||||
});
|
||||
flags.dom && console.groupEnd();
|
||||
}
|
||||
function takeRecords(node) {
|
||||
node = wrap(node);
|
||||
if (!node) {
|
||||
node = wrap(document);
|
||||
}
|
||||
while (node.parentNode) {
|
||||
node = node.parentNode;
|
||||
}
|
||||
var observer = node.__observer;
|
||||
if (observer) {
|
||||
handler(observer.takeRecords());
|
||||
takeMutations();
|
||||
}
|
||||
}
|
||||
var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach);
|
||||
function observe(inRoot) {
|
||||
if (inRoot.__observer) {
|
||||
return;
|
||||
}
|
||||
var observer = new MutationObserver(handler);
|
||||
observer.observe(inRoot, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
inRoot.__observer = observer;
|
||||
}
|
||||
function upgradeDocument(doc) {
|
||||
doc = wrap(doc);
|
||||
flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop());
|
||||
addedNode(doc);
|
||||
observe(doc);
|
||||
flags.dom && console.groupEnd();
|
||||
}
|
||||
function upgradeDocumentTree(doc) {
|
||||
forDocumentTree(doc, upgradeDocument);
|
||||
}
|
||||
var originalCreateShadowRoot = Element.prototype.createShadowRoot;
|
||||
if (originalCreateShadowRoot) {
|
||||
Element.prototype.createShadowRoot = function() {
|
||||
var root = originalCreateShadowRoot.call(this);
|
||||
CustomElements.watchShadow(this);
|
||||
return root;
|
||||
};
|
||||
}
|
||||
scope.watchShadow = watchShadow;
|
||||
scope.upgradeDocumentTree = upgradeDocumentTree;
|
||||
scope.upgradeSubtree = addedSubtree;
|
||||
scope.upgradeAll = addedNode;
|
||||
scope.attachedNode = attachedNode;
|
||||
scope.takeRecords = takeRecords;
|
||||
});
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var flags = scope.flags;
|
||||
function upgrade(node) {
|
||||
if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
|
||||
var is = node.getAttribute("is");
|
||||
var definition = scope.getRegisteredDefinition(is || node.localName);
|
||||
if (definition) {
|
||||
if (is && definition.tag == node.localName) {
|
||||
return upgradeWithDefinition(node, definition);
|
||||
} else if (!is && !definition.extends) {
|
||||
return upgradeWithDefinition(node, definition);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function upgradeWithDefinition(element, definition) {
|
||||
flags.upgrade && console.group("upgrade:", element.localName);
|
||||
if (definition.is) {
|
||||
element.setAttribute("is", definition.is);
|
||||
}
|
||||
implementPrototype(element, definition);
|
||||
element.__upgraded__ = true;
|
||||
created(element);
|
||||
scope.attachedNode(element);
|
||||
scope.upgradeSubtree(element);
|
||||
flags.upgrade && console.groupEnd();
|
||||
return element;
|
||||
}
|
||||
function implementPrototype(element, definition) {
|
||||
if (Object.__proto__) {
|
||||
element.__proto__ = definition.prototype;
|
||||
} else {
|
||||
customMixin(element, definition.prototype, definition.native);
|
||||
element.__proto__ = definition.prototype;
|
||||
}
|
||||
}
|
||||
function customMixin(inTarget, inSrc, inNative) {
|
||||
var used = {};
|
||||
var p = inSrc;
|
||||
while (p !== inNative && p !== HTMLElement.prototype) {
|
||||
var keys = Object.getOwnPropertyNames(p);
|
||||
for (var i = 0, k; k = keys[i]; i++) {
|
||||
if (!used[k]) {
|
||||
Object.defineProperty(inTarget, k, Object.getOwnPropertyDescriptor(p, k));
|
||||
used[k] = 1;
|
||||
}
|
||||
}
|
||||
p = Object.getPrototypeOf(p);
|
||||
}
|
||||
}
|
||||
function created(element) {
|
||||
if (element.createdCallback) {
|
||||
element.createdCallback();
|
||||
}
|
||||
}
|
||||
scope.upgrade = upgrade;
|
||||
scope.upgradeWithDefinition = upgradeWithDefinition;
|
||||
scope.implementPrototype = implementPrototype;
|
||||
});
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var isIE11OrOlder = scope.isIE11OrOlder;
|
||||
var upgradeDocumentTree = scope.upgradeDocumentTree;
|
||||
var upgradeAll = scope.upgradeAll;
|
||||
var upgradeWithDefinition = scope.upgradeWithDefinition;
|
||||
var implementPrototype = scope.implementPrototype;
|
||||
var useNative = scope.useNative;
|
||||
function register(name, options) {
|
||||
var definition = options || {};
|
||||
if (!name) {
|
||||
throw new Error("document.registerElement: first argument `name` must not be empty");
|
||||
}
|
||||
if (name.indexOf("-") < 0) {
|
||||
throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '" + String(name) + "'.");
|
||||
}
|
||||
if (isReservedTag(name)) {
|
||||
throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '" + String(name) + "'. The type name is invalid.");
|
||||
}
|
||||
if (getRegisteredDefinition(name)) {
|
||||
throw new Error("DuplicateDefinitionError: a type with name '" + String(name) + "' is already registered");
|
||||
}
|
||||
if (!definition.prototype) {
|
||||
definition.prototype = Object.create(HTMLElement.prototype);
|
||||
}
|
||||
definition.__name = name.toLowerCase();
|
||||
definition.lifecycle = definition.lifecycle || {};
|
||||
definition.ancestry = ancestry(definition.extends);
|
||||
resolveTagName(definition);
|
||||
resolvePrototypeChain(definition);
|
||||
overrideAttributeApi(definition.prototype);
|
||||
registerDefinition(definition.__name, definition);
|
||||
definition.ctor = generateConstructor(definition);
|
||||
definition.ctor.prototype = definition.prototype;
|
||||
definition.prototype.constructor = definition.ctor;
|
||||
if (scope.ready) {
|
||||
upgradeDocumentTree(document);
|
||||
}
|
||||
return definition.ctor;
|
||||
}
|
||||
function overrideAttributeApi(prototype) {
|
||||
if (prototype.setAttribute._polyfilled) {
|
||||
return;
|
||||
}
|
||||
var setAttribute = prototype.setAttribute;
|
||||
prototype.setAttribute = function(name, value) {
|
||||
changeAttribute.call(this, name, value, setAttribute);
|
||||
};
|
||||
var removeAttribute = prototype.removeAttribute;
|
||||
prototype.removeAttribute = function(name) {
|
||||
changeAttribute.call(this, name, null, removeAttribute);
|
||||
};
|
||||
prototype.setAttribute._polyfilled = true;
|
||||
}
|
||||
function changeAttribute(name, value, operation) {
|
||||
name = name.toLowerCase();
|
||||
var oldValue = this.getAttribute(name);
|
||||
operation.apply(this, arguments);
|
||||
var newValue = this.getAttribute(name);
|
||||
if (this.attributeChangedCallback && newValue !== oldValue) {
|
||||
this.attributeChangedCallback(name, oldValue, newValue);
|
||||
}
|
||||
}
|
||||
function isReservedTag(name) {
|
||||
for (var i = 0; i < reservedTagList.length; i++) {
|
||||
if (name === reservedTagList[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
var reservedTagList = [ "annotation-xml", "color-profile", "font-face", "font-face-src", "font-face-uri", "font-face-format", "font-face-name", "missing-glyph" ];
|
||||
function ancestry(extnds) {
|
||||
var extendee = getRegisteredDefinition(extnds);
|
||||
if (extendee) {
|
||||
return ancestry(extendee.extends).concat([ extendee ]);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
function resolveTagName(definition) {
|
||||
var baseTag = definition.extends;
|
||||
for (var i = 0, a; a = definition.ancestry[i]; i++) {
|
||||
baseTag = a.is && a.tag;
|
||||
}
|
||||
definition.tag = baseTag || definition.__name;
|
||||
if (baseTag) {
|
||||
definition.is = definition.__name;
|
||||
}
|
||||
}
|
||||
function resolvePrototypeChain(definition) {
|
||||
if (!Object.__proto__) {
|
||||
var nativePrototype = HTMLElement.prototype;
|
||||
if (definition.is) {
|
||||
var inst = document.createElement(definition.tag);
|
||||
var expectedPrototype = Object.getPrototypeOf(inst);
|
||||
if (expectedPrototype === definition.prototype) {
|
||||
nativePrototype = expectedPrototype;
|
||||
}
|
||||
}
|
||||
var proto = definition.prototype, ancestor;
|
||||
while (proto && proto !== nativePrototype) {
|
||||
ancestor = Object.getPrototypeOf(proto);
|
||||
proto.__proto__ = ancestor;
|
||||
proto = ancestor;
|
||||
}
|
||||
definition.native = nativePrototype;
|
||||
}
|
||||
}
|
||||
function instantiate(definition) {
|
||||
return upgradeWithDefinition(domCreateElement(definition.tag), definition);
|
||||
}
|
||||
var registry = {};
|
||||
function getRegisteredDefinition(name) {
|
||||
if (name) {
|
||||
return registry[name.toLowerCase()];
|
||||
}
|
||||
}
|
||||
function registerDefinition(name, definition) {
|
||||
registry[name] = definition;
|
||||
}
|
||||
function generateConstructor(definition) {
|
||||
return function() {
|
||||
return instantiate(definition);
|
||||
};
|
||||
}
|
||||
var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
||||
function createElementNS(namespace, tag, typeExtension) {
|
||||
if (namespace === HTML_NAMESPACE) {
|
||||
return createElement(tag, typeExtension);
|
||||
} else {
|
||||
return domCreateElementNS(namespace, tag);
|
||||
}
|
||||
}
|
||||
function createElement(tag, typeExtension) {
|
||||
if (tag) {
|
||||
tag = tag.toLowerCase();
|
||||
}
|
||||
if (typeExtension) {
|
||||
typeExtension = typeExtension.toLowerCase();
|
||||
}
|
||||
var definition = getRegisteredDefinition(typeExtension || tag);
|
||||
if (definition) {
|
||||
if (tag == definition.tag && typeExtension == definition.is) {
|
||||
return new definition.ctor();
|
||||
}
|
||||
if (!typeExtension && !definition.is) {
|
||||
return new definition.ctor();
|
||||
}
|
||||
}
|
||||
var element;
|
||||
if (typeExtension) {
|
||||
element = createElement(tag);
|
||||
element.setAttribute("is", typeExtension);
|
||||
return element;
|
||||
}
|
||||
element = domCreateElement(tag);
|
||||
if (tag.indexOf("-") >= 0) {
|
||||
implementPrototype(element, HTMLElement);
|
||||
}
|
||||
return element;
|
||||
}
|
||||
var domCreateElement = document.createElement.bind(document);
|
||||
var domCreateElementNS = document.createElementNS.bind(document);
|
||||
var isInstance;
|
||||
if (!Object.__proto__ && !useNative) {
|
||||
isInstance = function(obj, ctor) {
|
||||
var p = obj;
|
||||
while (p) {
|
||||
if (p === ctor.prototype) {
|
||||
return true;
|
||||
}
|
||||
p = p.__proto__;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
} else {
|
||||
isInstance = function(obj, base) {
|
||||
return obj instanceof base;
|
||||
};
|
||||
}
|
||||
function wrapDomMethodToForceUpgrade(obj, methodName) {
|
||||
var orig = obj[methodName];
|
||||
obj[methodName] = function() {
|
||||
var n = orig.apply(this, arguments);
|
||||
upgradeAll(n);
|
||||
return n;
|
||||
};
|
||||
}
|
||||
wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode");
|
||||
wrapDomMethodToForceUpgrade(document, "importNode");
|
||||
if (isIE11OrOlder) {
|
||||
(function() {
|
||||
var importNode = document.importNode;
|
||||
document.importNode = function() {
|
||||
var n = importNode.apply(document, arguments);
|
||||
if (n.nodeType == n.DOCUMENT_FRAGMENT_NODE) {
|
||||
var f = document.createDocumentFragment();
|
||||
f.appendChild(n);
|
||||
return f;
|
||||
} else {
|
||||
return n;
|
||||
}
|
||||
};
|
||||
})();
|
||||
}
|
||||
document.registerElement = register;
|
||||
document.createElement = createElement;
|
||||
document.createElementNS = createElementNS;
|
||||
scope.registry = registry;
|
||||
scope.instanceof = isInstance;
|
||||
scope.reservedTagList = reservedTagList;
|
||||
scope.getRegisteredDefinition = getRegisteredDefinition;
|
||||
document.register = document.registerElement;
|
||||
});
|
||||
|
||||
(function(scope) {
|
||||
var useNative = scope.useNative;
|
||||
var initializeModules = scope.initializeModules;
|
||||
var isIE11OrOlder = /Trident/.test(navigator.userAgent);
|
||||
if (useNative) {
|
||||
var nop = function() {};
|
||||
scope.watchShadow = nop;
|
||||
scope.upgrade = nop;
|
||||
scope.upgradeAll = nop;
|
||||
scope.upgradeDocumentTree = nop;
|
||||
scope.upgradeSubtree = nop;
|
||||
scope.takeRecords = nop;
|
||||
scope.instanceof = function(obj, base) {
|
||||
return obj instanceof base;
|
||||
};
|
||||
} else {
|
||||
initializeModules();
|
||||
}
|
||||
var upgradeDocumentTree = scope.upgradeDocumentTree;
|
||||
if (!window.wrap) {
|
||||
if (window.ShadowDOMPolyfill) {
|
||||
window.wrap = ShadowDOMPolyfill.wrapIfNeeded;
|
||||
window.unwrap = ShadowDOMPolyfill.unwrapIfNeeded;
|
||||
} else {
|
||||
window.wrap = window.unwrap = function(node) {
|
||||
return node;
|
||||
};
|
||||
}
|
||||
}
|
||||
function bootstrap() {
|
||||
upgradeDocumentTree(wrap(document));
|
||||
if (window.HTMLImports) {
|
||||
HTMLImports.__importsParsingHook = function(elt) {
|
||||
upgradeDocumentTree(wrap(elt.import));
|
||||
};
|
||||
}
|
||||
CustomElements.ready = true;
|
||||
setTimeout(function() {
|
||||
CustomElements.readyTime = Date.now();
|
||||
if (window.HTMLImports) {
|
||||
CustomElements.elapsed = CustomElements.readyTime - HTMLImports.readyTime;
|
||||
}
|
||||
document.dispatchEvent(new CustomEvent("WebComponentsReady", {
|
||||
bubbles: true
|
||||
}));
|
||||
});
|
||||
}
|
||||
if (isIE11OrOlder && typeof window.CustomEvent !== "function") {
|
||||
window.CustomEvent = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("CustomEvent");
|
||||
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
|
||||
return e;
|
||||
};
|
||||
window.CustomEvent.prototype = window.Event.prototype;
|
||||
}
|
||||
if (document.readyState === "complete" || scope.flags.eager) {
|
||||
bootstrap();
|
||||
} else if (document.readyState === "interactive" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) {
|
||||
bootstrap();
|
||||
} else {
|
||||
var loadEvent = window.HTMLImports && !HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded";
|
||||
window.addEventListener(loadEvent, bootstrap);
|
||||
}
|
||||
scope.isIE11OrOlder = isIE11OrOlder;
|
||||
})(window.CustomElements);
|
1078
dashboard-ui/thirdparty/webcomponentsjs/HTMLImports.js
vendored
|
@ -1,344 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
* Code distributed by Google as part of the polymer project is also
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
// @version 0.7.3
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
var counter = Date.now() % 1e9;
|
||||
var WeakMap = function() {
|
||||
this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__");
|
||||
};
|
||||
WeakMap.prototype = {
|
||||
set: function(key, value) {
|
||||
var entry = key[this.name];
|
||||
if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {
|
||||
value: [ key, value ],
|
||||
writable: true
|
||||
});
|
||||
return this;
|
||||
},
|
||||
get: function(key) {
|
||||
var entry;
|
||||
return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
|
||||
},
|
||||
"delete": function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry || entry[0] !== key) return false;
|
||||
entry[0] = entry[1] = undefined;
|
||||
return true;
|
||||
},
|
||||
has: function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry) return false;
|
||||
return entry[0] === key;
|
||||
}
|
||||
};
|
||||
window.WeakMap = WeakMap;
|
||||
})();
|
||||
}
|
||||
|
||||
(function(global) {
|
||||
var registrationsTable = new WeakMap();
|
||||
var setImmediate;
|
||||
if (/Trident|Edge/.test(navigator.userAgent)) {
|
||||
setImmediate = setTimeout;
|
||||
} else if (window.setImmediate) {
|
||||
setImmediate = window.setImmediate;
|
||||
} else {
|
||||
var setImmediateQueue = [];
|
||||
var sentinel = String(Math.random());
|
||||
window.addEventListener("message", function(e) {
|
||||
if (e.data === sentinel) {
|
||||
var queue = setImmediateQueue;
|
||||
setImmediateQueue = [];
|
||||
queue.forEach(function(func) {
|
||||
func();
|
||||
});
|
||||
}
|
||||
});
|
||||
setImmediate = function(func) {
|
||||
setImmediateQueue.push(func);
|
||||
window.postMessage(sentinel, "*");
|
||||
};
|
||||
}
|
||||
var isScheduled = false;
|
||||
var scheduledObservers = [];
|
||||
function scheduleCallback(observer) {
|
||||
scheduledObservers.push(observer);
|
||||
if (!isScheduled) {
|
||||
isScheduled = true;
|
||||
setImmediate(dispatchCallbacks);
|
||||
}
|
||||
}
|
||||
function wrapIfNeeded(node) {
|
||||
return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;
|
||||
}
|
||||
function dispatchCallbacks() {
|
||||
isScheduled = false;
|
||||
var observers = scheduledObservers;
|
||||
scheduledObservers = [];
|
||||
observers.sort(function(o1, o2) {
|
||||
return o1.uid_ - o2.uid_;
|
||||
});
|
||||
var anyNonEmpty = false;
|
||||
observers.forEach(function(observer) {
|
||||
var queue = observer.takeRecords();
|
||||
removeTransientObserversFor(observer);
|
||||
if (queue.length) {
|
||||
observer.callback_(queue, observer);
|
||||
anyNonEmpty = true;
|
||||
}
|
||||
});
|
||||
if (anyNonEmpty) dispatchCallbacks();
|
||||
}
|
||||
function removeTransientObserversFor(observer) {
|
||||
observer.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) return;
|
||||
registrations.forEach(function(registration) {
|
||||
if (registration.observer === observer) registration.removeTransientObservers();
|
||||
});
|
||||
});
|
||||
}
|
||||
function forEachAncestorAndObserverEnqueueRecord(target, callback) {
|
||||
for (var node = target; node; node = node.parentNode) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (registrations) {
|
||||
for (var j = 0; j < registrations.length; j++) {
|
||||
var registration = registrations[j];
|
||||
var options = registration.options;
|
||||
if (node !== target && !options.subtree) continue;
|
||||
var record = callback(options);
|
||||
if (record) registration.enqueue(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var uidCounter = 0;
|
||||
function JsMutationObserver(callback) {
|
||||
this.callback_ = callback;
|
||||
this.nodes_ = [];
|
||||
this.records_ = [];
|
||||
this.uid_ = ++uidCounter;
|
||||
}
|
||||
JsMutationObserver.prototype = {
|
||||
observe: function(target, options) {
|
||||
target = wrapIfNeeded(target);
|
||||
if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
|
||||
throw new SyntaxError();
|
||||
}
|
||||
var registrations = registrationsTable.get(target);
|
||||
if (!registrations) registrationsTable.set(target, registrations = []);
|
||||
var registration;
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i].observer === this) {
|
||||
registration = registrations[i];
|
||||
registration.removeListeners();
|
||||
registration.options = options;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!registration) {
|
||||
registration = new Registration(this, target, options);
|
||||
registrations.push(registration);
|
||||
this.nodes_.push(target);
|
||||
}
|
||||
registration.addListeners();
|
||||
},
|
||||
disconnect: function() {
|
||||
this.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
var registration = registrations[i];
|
||||
if (registration.observer === this) {
|
||||
registration.removeListeners();
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
this.records_ = [];
|
||||
},
|
||||
takeRecords: function() {
|
||||
var copyOfRecords = this.records_;
|
||||
this.records_ = [];
|
||||
return copyOfRecords;
|
||||
}
|
||||
};
|
||||
function MutationRecord(type, target) {
|
||||
this.type = type;
|
||||
this.target = target;
|
||||
this.addedNodes = [];
|
||||
this.removedNodes = [];
|
||||
this.previousSibling = null;
|
||||
this.nextSibling = null;
|
||||
this.attributeName = null;
|
||||
this.attributeNamespace = null;
|
||||
this.oldValue = null;
|
||||
}
|
||||
function copyMutationRecord(original) {
|
||||
var record = new MutationRecord(original.type, original.target);
|
||||
record.addedNodes = original.addedNodes.slice();
|
||||
record.removedNodes = original.removedNodes.slice();
|
||||
record.previousSibling = original.previousSibling;
|
||||
record.nextSibling = original.nextSibling;
|
||||
record.attributeName = original.attributeName;
|
||||
record.attributeNamespace = original.attributeNamespace;
|
||||
record.oldValue = original.oldValue;
|
||||
return record;
|
||||
}
|
||||
var currentRecord, recordWithOldValue;
|
||||
function getRecord(type, target) {
|
||||
return currentRecord = new MutationRecord(type, target);
|
||||
}
|
||||
function getRecordWithOldValue(oldValue) {
|
||||
if (recordWithOldValue) return recordWithOldValue;
|
||||
recordWithOldValue = copyMutationRecord(currentRecord);
|
||||
recordWithOldValue.oldValue = oldValue;
|
||||
return recordWithOldValue;
|
||||
}
|
||||
function clearRecords() {
|
||||
currentRecord = recordWithOldValue = undefined;
|
||||
}
|
||||
function recordRepresentsCurrentMutation(record) {
|
||||
return record === recordWithOldValue || record === currentRecord;
|
||||
}
|
||||
function selectRecord(lastRecord, newRecord) {
|
||||
if (lastRecord === newRecord) return lastRecord;
|
||||
if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue;
|
||||
return null;
|
||||
}
|
||||
function Registration(observer, target, options) {
|
||||
this.observer = observer;
|
||||
this.target = target;
|
||||
this.options = options;
|
||||
this.transientObservedNodes = [];
|
||||
}
|
||||
Registration.prototype = {
|
||||
enqueue: function(record) {
|
||||
var records = this.observer.records_;
|
||||
var length = records.length;
|
||||
if (records.length > 0) {
|
||||
var lastRecord = records[length - 1];
|
||||
var recordToReplaceLast = selectRecord(lastRecord, record);
|
||||
if (recordToReplaceLast) {
|
||||
records[length - 1] = recordToReplaceLast;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
scheduleCallback(this.observer);
|
||||
}
|
||||
records[length] = record;
|
||||
},
|
||||
addListeners: function() {
|
||||
this.addListeners_(this.target);
|
||||
},
|
||||
addListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.addEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.addEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
removeListeners: function() {
|
||||
this.removeListeners_(this.target);
|
||||
},
|
||||
removeListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.removeEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.removeEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
addTransientObserver: function(node) {
|
||||
if (node === this.target) return;
|
||||
this.addListeners_(node);
|
||||
this.transientObservedNodes.push(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) registrationsTable.set(node, registrations = []);
|
||||
registrations.push(this);
|
||||
},
|
||||
removeTransientObservers: function() {
|
||||
var transientObservedNodes = this.transientObservedNodes;
|
||||
this.transientObservedNodes = [];
|
||||
transientObservedNodes.forEach(function(node) {
|
||||
this.removeListeners_(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i] === this) {
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
handleEvent: function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
switch (e.type) {
|
||||
case "DOMAttrModified":
|
||||
var name = e.attrName;
|
||||
var namespace = e.relatedNode.namespaceURI;
|
||||
var target = e.target;
|
||||
var record = new getRecord("attributes", target);
|
||||
record.attributeName = name;
|
||||
record.attributeNamespace = namespace;
|
||||
var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.attributes) return;
|
||||
if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {
|
||||
return;
|
||||
}
|
||||
if (options.attributeOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMCharacterDataModified":
|
||||
var target = e.target;
|
||||
var record = getRecord("characterData", target);
|
||||
var oldValue = e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.characterData) return;
|
||||
if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMNodeRemoved":
|
||||
this.addTransientObserver(e.target);
|
||||
|
||||
case "DOMNodeInserted":
|
||||
var changedNode = e.target;
|
||||
var addedNodes, removedNodes;
|
||||
if (e.type === "DOMNodeInserted") {
|
||||
addedNodes = [ changedNode ];
|
||||
removedNodes = [];
|
||||
} else {
|
||||
addedNodes = [];
|
||||
removedNodes = [ changedNode ];
|
||||
}
|
||||
var previousSibling = changedNode.previousSibling;
|
||||
var nextSibling = changedNode.nextSibling;
|
||||
var record = getRecord("childList", e.target.parentNode);
|
||||
record.addedNodes = addedNodes;
|
||||
record.removedNodes = removedNodes;
|
||||
record.previousSibling = previousSibling;
|
||||
record.nextSibling = nextSibling;
|
||||
forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) {
|
||||
if (!options.childList) return;
|
||||
return record;
|
||||
});
|
||||
}
|
||||
clearRecords();
|
||||
}
|
||||
};
|
||||
global.JsMutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
|
||||
})(this);
|
|
@ -33,8 +33,6 @@
|
|||
<a href="http://emby.media/download" target="_blank" title="Kodi">
|
||||
<img src="css/images/clients/kodi.png" />
|
||||
</a>
|
||||
<a href="http://forum.team-mediaportal.com/threads/plugin-mediabrowser-for-mediaportal-v0-13-beta-2013-10-21.119513" target="_blank" title="Media Portal">
|
||||
<img src="css/images/clients/mediaportal.png" /></a>
|
||||
</p>
|
||||
|
||||
<div class="wizardNavigation">
|
||||
|
|