Merge pull request #1436 from MediaBrowser/dev

Merge from dev
This commit is contained in:
Luke 2016-02-08 13:27:08 -05:00
commit 3f87605135
289 changed files with 2572 additions and 2736 deletions

View file

@ -4,7 +4,7 @@
<title>${TitlePlugins}</title> <title>${TitlePlugins}</title>
</head> </head>
<body> <body>
<div id="addPluginPage" data-role="page" class="page type-interior pluginConfigurationPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Plugins" data-require="registrationservices,scripts/ratingdialog,scripts/addpluginpage"> <div id="addPluginPage" data-role="page" class="page type-interior pluginConfigurationPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Plugins" data-require="jqmcollapsible,registrationservices,scripts/ratingdialog,scripts/addpluginpage">
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">

View file

@ -4,7 +4,7 @@
<title>${TitleAdvanced}</title> <title>${TitleAdvanced}</title>
</head> </head>
<body> <body>
<div id="advancedConfigurationPage" data-role="page" class="page type-interior advancedConfigurationPage" data-require="scripts/advancedconfigurationpage,paper-input"> <div id="advancedConfigurationPage" data-role="page" class="page type-interior advancedConfigurationPage" data-require="jqmcollapsible,scripts/advancedconfigurationpage,paper-input">
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">

View file

@ -12,6 +12,7 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true"> <div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="#" data-role="button" class="ui-btn-active">${TabActivityLog}</a> <a href="#" data-role="button" class="ui-btn-active">${TabActivityLog}</a>
<a href="autoorganizetv.html" data-role="button">${TabTV}</a> <a href="autoorganizetv.html" data-role="button">${TabTV}</a>
<a href="autoorganizesmart.html" data-role="button">${TabSmartMatches}</a>
</div> </div>
<div style="margin: -25px 0 1em; text-align: right;"> <div style="margin: -25px 0 1em; text-align: right;">
@ -80,6 +81,10 @@
<input id="txtEndingEpisode" type="number" pattern="[0-9]*" min="0" /> <input id="txtEndingEpisode" type="number" pattern="[0-9]*" min="0" />
<div class="fieldDescription">${LabelEndingEpisodeNumberHelp}</div> <div class="fieldDescription">${LabelEndingEpisodeNumberHelp}</div>
</div> </div>
<div style="margin: 1em 0;">
<input type="checkbox" id="chkRememberCorrection" name="chkRememberCorrection" data-mini="true" />
<label for="chkRememberCorrection">${LabelOrganizeSmartMatchOption} '<span class="extractedName" />' </label>
</div>
<p> <p>
<button type="submit" data-theme="b" data-icon="check" data-mini="true"> <button type="submit" data-theme="b" data-icon="check" data-mini="true">

View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<title>${TitleAutoOrganize}</title>
</head>
<body>
<div id="libraryFileOrganizerSmartMatchPage" data-role="page" class="page type-interior organizePage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Auto-Organize" data-require="scripts/autoorganizesmart,jqmlistview">
<div data-role="content">
<div class="content-primary">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="autoorganizelog.html" data-role="button">${TabActivityLog}</a>
<a href="autoorganizetv.html" data-role="button">${TabTV}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabSmartMatches}</a>
</div>
<div class="readOnlyContent">
<p>${TabSmartMatchInfo}</p>
<div class="divMatchInfos"></div>
</div>
</div>
</div>
</div>
</body>
</html>

View file

@ -4,13 +4,14 @@
<title>${TitleAutoOrganize}</title> <title>${TitleAutoOrganize}</title>
</head> </head>
<body> <body>
<div id="libraryFileOrganizerPage" data-role="page" class="page type-interior organizePage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Auto-Organize" data-require="jqmtable,scripts/autoorganizetv,paper-input"> <div id="libraryFileOrganizerPage" data-role="page" class="page type-interior organizePage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Auto-Organize" data-require="jqmcollapsible,jqmtable,scripts/autoorganizetv,paper-input">
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true"> <div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="autoorganizelog.html" data-role="button">${TabActivityLog}</a> <a href="autoorganizelog.html" data-role="button">${TabActivityLog}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabTV}</a> <a href="#" data-role="button" class="ui-btn-active">${TabTV}</a>
<a href="autoorganizesmart.html" data-role="button">${TabSmartMatches}</a>
</div> </div>
<form class="libraryFileOrganizerForm"> <form class="libraryFileOrganizerForm">

View file

@ -5,7 +5,7 @@
"url": "https://github.com/nolimits4web/Swiper.git" "url": "https://github.com/nolimits4web/Swiper.git"
}, },
"description": "Most modern mobile touch slider and framework with hardware accelerated transitions", "description": "Most modern mobile touch slider and framework with hardware accelerated transitions",
"version": "3.3.0", "version": "3.3.1",
"author": "Vladimir Kharlampidi", "author": "Vladimir Kharlampidi",
"homepage": "http://www.idangero.us/swiper/", "homepage": "http://www.idangero.us/swiper/",
"keywords": [ "keywords": [
@ -45,14 +45,13 @@
"playground", "playground",
"package.json" "package.json"
], ],
"_release": "3.3.0", "_release": "3.3.1",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v3.3.0", "tag": "v3.3.1",
"commit": "d1b5b19c872068ebb14bfb854af838c30285cecd" "commit": "33101a659e579146f5462e4a9d6a7fdfd7436c35"
}, },
"_source": "git://github.com/nolimits4web/Swiper.git", "_source": "git://github.com/nolimits4web/Swiper.git",
"_target": "~3.3.0", "_target": "~3.3.0",
"_originalSource": "swiper", "_originalSource": "swiper"
"_direct": true
} }

View file

@ -1,5 +1,14 @@
# Change Log # Change Log
## Swiper 3.3.1 - Released on February 7, 2016
* New `uniqueNavElements` parameter. If enabled (by default) and navigation elements' parameters passed as the string (like `.pagination`) then Swiper will look for such elements through child elements first. Applies for pagination, prev/next buttons and scrollbar
* New `onPaginationRendered` callback. Will be fired after pagination elements generated and added to DOM
* New `.reLoop()` method, which combines `.destroyLoop()` + `.createLoop()` methods with additional positioning fixes. Useful to call after you have changed `slidesPerView` parameter, it will dynamically recreate duplicated slides required for loop
* Fixed not working mousewheel control in IE 11
* Fixed issue with lazy loading images not being recalculated after window resize
* Fixed issues when using loop with breakpoints changing `slidesPerView/Group` parameters
* Numerous minor fixes
## Swiper 3.3.0 - Released on January 10, 2016 ## Swiper 3.3.0 - Released on January 10, 2016
* New 3D Flip effect. Can be enabled with `effect: 'flip' parameter * New 3D Flip effect. Can be enabled with `effect: 'flip' parameter
* New types of pagination with new parameters: * New types of pagination with new parameters:

View file

@ -5,7 +5,7 @@
"url": "https://github.com/nolimits4web/Swiper.git" "url": "https://github.com/nolimits4web/Swiper.git"
}, },
"description": "Most modern mobile touch slider and framework with hardware accelerated transitions", "description": "Most modern mobile touch slider and framework with hardware accelerated transitions",
"version": "3.3.0", "version": "3.3.1",
"author": "Vladimir Kharlampidi", "author": "Vladimir Kharlampidi",
"homepage": "http://www.idangero.us/swiper/", "homepage": "http://www.idangero.us/swiper/",
"keywords": ["swiper", "swipe", "slider", "touch", "ios", "mobile", "cordova", "phonegap", "app", "framework", "carousel", "gallery"], "keywords": ["swiper", "swipe", "slider", "touch", "ios", "mobile", "cordova", "phonegap", "app", "framework", "carousel", "gallery"],

View file

@ -2,7 +2,7 @@
"name": "swiper", "name": "swiper",
"repo": "https://github.com/nolimits4web/Swiper.git", "repo": "https://github.com/nolimits4web/Swiper.git",
"description": "Most modern mobile touch slider and framework with hardware accelerated transitions", "description": "Most modern mobile touch slider and framework with hardware accelerated transitions",
"version": "3.3.0", "version": "3.3.1",
"keywords": ["swiper", "swipe", "slider", "touch", "ios", "mobile", "cordova", "phonegap", "app", "framework", "carousel", "gallery"], "keywords": ["swiper", "swipe", "slider", "touch", "ios", "mobile", "cordova", "phonegap", "app", "framework", "carousel", "gallery"],
"dependencies": { "dependencies": {
}, },

View file

@ -1,5 +1,5 @@
/** /**
* Swiper 3.3.0 * Swiper 3.3.1
* Most modern mobile touch slider and framework with hardware accelerated transitions * Most modern mobile touch slider and framework with hardware accelerated transitions
* *
* http://www.idangero.us/swiper/ * http://www.idangero.us/swiper/
@ -10,7 +10,7 @@
* *
* Licensed under MIT * Licensed under MIT
* *
* Released on: January 10, 2016 * Released on: February 7, 2016
*/ */
.swiper-container { .swiper-container {
margin: 0 auto; margin: 0 auto;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/** /**
* Swiper 3.3.0 * Swiper 3.3.1
* Most modern mobile touch slider and framework with hardware accelerated transitions * Most modern mobile touch slider and framework with hardware accelerated transitions
* *
* http://www.idangero.us/swiper/ * http://www.idangero.us/swiper/
@ -10,7 +10,7 @@
* *
* Licensed under MIT * Licensed under MIT
* *
* Released on: January 10, 2016 * Released on: February 7, 2016
*/ */
(function () { (function () {
'use strict'; 'use strict';
@ -110,6 +110,8 @@
onlyExternal: false, onlyExternal: false,
threshold: 0, threshold: 0,
touchMoveStopPropagation: true, touchMoveStopPropagation: true,
// Unique Navigation Elements
uniqueNavElements: true,
// Pagination // Pagination
pagination: null, pagination: null,
paginationElement: 'span', paginationElement: 'span',
@ -298,10 +300,14 @@
var breakpoint = s.getActiveBreakpoint(); var breakpoint = s.getActiveBreakpoint();
if (breakpoint && s.currentBreakpoint !== breakpoint) { if (breakpoint && s.currentBreakpoint !== breakpoint) {
var breakPointsParams = breakpoint in s.params.breakpoints ? s.params.breakpoints[breakpoint] : s.originalParams; var breakPointsParams = breakpoint in s.params.breakpoints ? s.params.breakpoints[breakpoint] : s.originalParams;
var needsReLoop = s.params.loop && (breakPointsParams.slidesPerView !== s.params.slidesPerView);
for ( var param in breakPointsParams ) { for ( var param in breakPointsParams ) {
s.params[param] = breakPointsParams[param]; s.params[param] = breakPointsParams[param];
} }
s.currentBreakpoint = breakpoint; s.currentBreakpoint = breakpoint;
if(needsReLoop && s.destroyLoop) {
s.reLoop(true);
}
} }
}; };
// Set breakpoint on load // Set breakpoint on load
@ -315,10 +321,12 @@
s.container = $(container); s.container = $(container);
if (s.container.length === 0) return; if (s.container.length === 0) return;
if (s.container.length > 1) { if (s.container.length > 1) {
var swipers = [];
s.container.each(function () { s.container.each(function () {
new Swiper(this, params); var container = this;
swipers.push(new Swiper(this, params));
}); });
return; return swipers;
} }
// Save instance in container HTML Element and in data // Save instance in container HTML Element and in data
@ -387,6 +395,10 @@
// Pagination // Pagination
if (s.params.pagination) { if (s.params.pagination) {
s.paginationContainer = $(s.params.pagination); s.paginationContainer = $(s.params.pagination);
if (s.params.uniqueNavElements && typeof s.params.pagination === 'string' && s.paginationContainer.length > 1 && s.container.find(s.params.pagination).length === 1) {
s.paginationContainer = s.container.find(s.params.pagination);
}
if (s.params.paginationType === 'bullets' && s.params.paginationClickable) { if (s.params.paginationType === 'bullets' && s.params.paginationClickable) {
s.paginationContainer.addClass('swiper-pagination-clickable'); s.paginationContainer.addClass('swiper-pagination-clickable');
} }
@ -395,6 +407,21 @@
} }
s.paginationContainer.addClass('swiper-pagination-' + s.params.paginationType); s.paginationContainer.addClass('swiper-pagination-' + s.params.paginationType);
} }
// Next/Prev Buttons
if (s.params.nextButton || s.params.prevButton) {
if (s.params.nextButton) {
s.nextButton = $(s.params.nextButton);
if (s.params.uniqueNavElements && typeof s.params.nextButton === 'string' && s.nextButton.length > 1 && s.container.find(s.params.nextButton).length === 1) {
s.nextButton = s.container.find(s.params.nextButton);
}
}
if (s.params.prevButton) {
s.prevButton = $(s.params.prevButton);
if (s.params.uniqueNavElements && typeof s.params.prevButton === 'string' && s.prevButton.length > 1 && s.container.find(s.params.prevButton).length === 1) {
s.prevButton = s.container.find(s.params.prevButton);
}
}
}
// Is Horizontal // Is Horizontal
s.isHorizontal = function () { s.isHorizontal = function () {
@ -642,6 +669,7 @@
i, i,
prevSlideSize = 0, prevSlideSize = 0,
index = 0; index = 0;
if (typeof s.size === 'undefined') return;
if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) { if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * s.size; spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * s.size;
} }
@ -780,7 +808,7 @@
} }
} }
s.snapGrid = newSlidesGrid; s.snapGrid = newSlidesGrid;
if (Math.floor(s.virtualSize - s.size) > Math.floor(s.snapGrid[s.snapGrid.length - 1])) { if (Math.floor(s.virtualSize - s.size) - Math.floor(s.snapGrid[s.snapGrid.length - 1]) > 1) {
s.snapGrid.push(s.virtualSize - s.size); s.snapGrid.push(s.virtualSize - s.size);
} }
} }
@ -902,8 +930,16 @@
var activeSlide = s.slides.eq(s.activeIndex); var activeSlide = s.slides.eq(s.activeIndex);
// Active classes // Active classes
activeSlide.addClass(s.params.slideActiveClass); activeSlide.addClass(s.params.slideActiveClass);
activeSlide.next('.' + s.params.slideClass).addClass(s.params.slideNextClass); // Next Slide
activeSlide.prev('.' + s.params.slideClass).addClass(s.params.slidePrevClass); var nextSlide = activeSlide.next('.' + s.params.slideClass).addClass(s.params.slideNextClass);
if (s.params.loop && nextSlide.length === 0) {
s.slides.eq(0).addClass(s.params.slideNextClass);
}
// Prev Slide
var prevSlide = activeSlide.prev('.' + s.params.slideClass).addClass(s.params.slidePrevClass);
if (s.params.loop && prevSlide.length === 0) {
s.slides.eq(-1).addClass(s.params.slidePrevClass);
}
// Pagination // Pagination
if (s.paginationContainer && s.paginationContainer.length > 0) { if (s.paginationContainer && s.paginationContainer.length > 0) {
@ -911,7 +947,7 @@
var current, var current,
total = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length; total = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length;
if (s.params.loop) { if (s.params.loop) {
current = Math.ceil(s.activeIndex - s.loopedSlides)/s.params.slidesPerGroup; current = Math.ceil((s.activeIndex - s.loopedSlides)/s.params.slidesPerGroup);
if (current > s.slides.length - 1 - s.loopedSlides * 2) { if (current > s.slides.length - 1 - s.loopedSlides * 2) {
current = current - (s.slides.length - s.loopedSlides * 2); current = current - (s.slides.length - s.loopedSlides * 2);
} }
@ -954,29 +990,30 @@
} }
if (s.params.paginationType === 'custom' && s.params.paginationCustomRender) { if (s.params.paginationType === 'custom' && s.params.paginationCustomRender) {
s.paginationContainer.html(s.params.paginationCustomRender(s, current + 1, total)); s.paginationContainer.html(s.params.paginationCustomRender(s, current + 1, total));
s.emit('onPaginationRendered', s, s.paginationContainer[0]);
} }
} }
// Next/active buttons // Next/active buttons
if (!s.params.loop) { if (!s.params.loop) {
if (s.params.prevButton) { if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
if (s.isBeginning) { if (s.isBeginning) {
$(s.params.prevButton).addClass(s.params.buttonDisabledClass); s.prevButton.addClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.disable($(s.params.prevButton)); if (s.params.a11y && s.a11y) s.a11y.disable(s.prevButton);
} }
else { else {
$(s.params.prevButton).removeClass(s.params.buttonDisabledClass); s.prevButton.removeClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.enable($(s.params.prevButton)); if (s.params.a11y && s.a11y) s.a11y.enable(s.prevButton);
} }
} }
if (s.params.nextButton) { if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
if (s.isEnd) { if (s.isEnd) {
$(s.params.nextButton).addClass(s.params.buttonDisabledClass); s.nextButton.addClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.disable($(s.params.nextButton)); if (s.params.a11y && s.a11y) s.a11y.disable(s.nextButton);
} }
else { else {
$(s.params.nextButton).removeClass(s.params.buttonDisabledClass); s.nextButton.removeClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.enable($(s.params.nextButton)); if (s.params.a11y && s.a11y) s.a11y.enable(s.nextButton);
} }
} }
} }
@ -1026,6 +1063,9 @@
} }
s.paginationContainer.html(paginationHTML); s.paginationContainer.html(paginationHTML);
} }
if (s.params.paginationType !== 'custom') {
s.emit('onPaginationRendered', s, s.paginationContainer[0]);
}
} }
}; };
/*========================= /*=========================
@ -1097,6 +1137,7 @@
if (s.controller && s.controller.spline) { if (s.controller && s.controller.spline) {
s.controller.spline = undefined; s.controller.spline = undefined;
} }
var slideChangedBySlideTo = false;
if (s.params.freeMode) { if (s.params.freeMode) {
var newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate()); var newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate());
s.setWrapperTranslate(newTranslate); s.setWrapperTranslate(newTranslate);
@ -1110,12 +1151,15 @@
else { else {
s.updateClasses(); s.updateClasses();
if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) { if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) {
s.slideTo(s.slides.length - 1, 0, false, true); slideChangedBySlideTo = s.slideTo(s.slides.length - 1, 0, false, true);
} }
else { else {
s.slideTo(s.activeIndex, 0, false, true); slideChangedBySlideTo = s.slideTo(s.activeIndex, 0, false, true);
} }
} }
if (s.params.lazyLoading && !slideChangedBySlideTo && s.lazy) {
s.lazy.load();
}
// Return locks after resize // Return locks after resize
s.params.allowSwipeToPrev = allowSwipeToPrev; s.params.allowSwipeToPrev = allowSwipeToPrev;
s.params.allowSwipeToNext = allowSwipeToNext; s.params.allowSwipeToNext = allowSwipeToNext;
@ -1171,23 +1215,23 @@
window[action]('resize', s.onResize); window[action]('resize', s.onResize);
// Next, Prev, Index // Next, Prev, Index
if (s.params.nextButton) { if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
$(s.params.nextButton)[actionDom]('click', s.onClickNext); s.nextButton[actionDom]('click', s.onClickNext);
if (s.params.a11y && s.a11y) $(s.params.nextButton)[actionDom]('keydown', s.a11y.onEnterKey); if (s.params.a11y && s.a11y) s.nextButton[actionDom]('keydown', s.a11y.onEnterKey);
} }
if (s.params.prevButton) { if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
$(s.params.prevButton)[actionDom]('click', s.onClickPrev); s.prevButton[actionDom]('click', s.onClickPrev);
if (s.params.a11y && s.a11y) $(s.params.prevButton)[actionDom]('keydown', s.a11y.onEnterKey); if (s.params.a11y && s.a11y) s.prevButton[actionDom]('keydown', s.a11y.onEnterKey);
} }
if (s.params.pagination && s.params.paginationClickable) { if (s.params.pagination && s.params.paginationClickable) {
$(s.paginationContainer)[actionDom]('click', '.' + s.params.bulletClass, s.onClickIndex); s.paginationContainer[actionDom]('click', '.' + s.params.bulletClass, s.onClickIndex);
if (s.params.a11y && s.a11y) $(s.paginationContainer)[actionDom]('keydown', '.' + s.params.bulletClass, s.a11y.onEnterKey); if (s.params.a11y && s.a11y) s.paginationContainer[actionDom]('keydown', '.' + s.params.bulletClass, s.a11y.onEnterKey);
} }
// Prevent Links Clicks // Prevent Links Clicks
if (s.params.preventClicks || s.params.preventClicksPropagation) touchEventsTarget[action]('click', s.preventClicks, true); if (s.params.preventClicks || s.params.preventClicksPropagation) touchEventsTarget[action]('click', s.preventClicks, true);
}; };
s.attachEvents = function (detach) { s.attachEvents = function () {
s.initEvents(); s.initEvents();
}; };
s.detachEvents = function () { s.detachEvents = function () {
@ -1383,7 +1427,11 @@
s.onTouchMove = function (e) { s.onTouchMove = function (e) {
if (e.originalEvent) e = e.originalEvent; if (e.originalEvent) e = e.originalEvent;
if (isTouchEvent && e.type === 'mousemove') return; if (isTouchEvent && e.type === 'mousemove') return;
if (e.preventedByNestedSwiper) return; if (e.preventedByNestedSwiper) {
s.touches.startX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
s.touches.startY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
return;
}
if (s.params.onlyExternal) { if (s.params.onlyExternal) {
// isMoved = true; // isMoved = true;
s.allowClick = false; s.allowClick = false;
@ -2148,6 +2196,16 @@
s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove(); s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove();
s.slides.removeAttr('data-swiper-slide-index'); s.slides.removeAttr('data-swiper-slide-index');
}; };
s.reLoop = function (updatePosition) {
var oldIndex = s.activeIndex - s.loopedSlides;
s.destroyLoop();
s.createLoop();
s.updateSlidesSize();
if (updatePosition) {
s.slideTo(oldIndex + s.loopedSlides, 0, false);
}
};
s.fixLoop = function () { s.fixLoop = function () {
var newIndex; var newIndex;
//Fix For Negative Oversliding //Fix For Negative Oversliding
@ -2555,7 +2613,7 @@
srcset = _img.attr('data-srcset'); srcset = _img.attr('data-srcset');
s.loadImage(_img[0], (src || background), srcset, false, function () { s.loadImage(_img[0], (src || background), srcset, false, function () {
if (background) { if (background) {
_img.css('background-image', 'url(' + background + ')'); _img.css('background-image', 'url("' + background + '")');
_img.removeAttr('data-background'); _img.removeAttr('data-background');
} }
else { else {
@ -2734,6 +2792,9 @@
if (!s.params.scrollbar) return; if (!s.params.scrollbar) return;
var sb = s.scrollbar; var sb = s.scrollbar;
sb.track = $(s.params.scrollbar); sb.track = $(s.params.scrollbar);
if (s.params.uniqueNavElements && typeof s.params.scrollbar === 'string' && sb.track.length > 1 && s.container.find(s.params.scrollbar).length === 1) {
sb.track = s.container.find(s.params.scrollbar);
}
sb.drag = sb.track.find('.swiper-scrollbar-drag'); sb.drag = sb.track.find('.swiper-scrollbar-drag');
if (sb.drag.length === 0) { if (sb.drag.length === 0) {
sb.drag = $('<div class="swiper-scrollbar-drag"></div>'); sb.drag = $('<div class="swiper-scrollbar-drag"></div>');
@ -3056,8 +3117,14 @@
try { try {
new window.WheelEvent('wheel'); new window.WheelEvent('wheel');
s.mousewheel.event = 'wheel'; s.mousewheel.event = 'wheel';
} catch (e) {} } catch (e) {
if (window.WheelEvent || (s.container[0] && 'wheel' in s.container[0])) {
s.mousewheel.event = 'wheel';
}
}
if (!s.mousewheel.event && window.WheelEvent) {
}
if (!s.mousewheel.event && document.onmousewheel !== undefined) { if (!s.mousewheel.event && document.onmousewheel !== undefined) {
s.mousewheel.event = 'mousewheel'; s.mousewheel.event = 'mousewheel';
} }
@ -3070,10 +3137,9 @@
var we = s.mousewheel.event; var we = s.mousewheel.event;
var delta = 0; var delta = 0;
var rtlFactor = s.rtl ? -1 : 1; var rtlFactor = s.rtl ? -1 : 1;
//Opera & IE
if (e.detail) delta = -e.detail;
//WebKits //WebKits
else if (we === 'mousewheel') { if (we === 'mousewheel') {
if (s.params.mousewheelForceToAxis) { if (s.params.mousewheelForceToAxis) {
if (s.isHorizontal()) { if (s.isHorizontal()) {
if (Math.abs(e.wheelDeltaX) > Math.abs(e.wheelDeltaY)) delta = e.wheelDeltaX * rtlFactor; if (Math.abs(e.wheelDeltaX) > Math.abs(e.wheelDeltaY)) delta = e.wheelDeltaX * rtlFactor;
@ -3383,17 +3449,15 @@
}, },
init: function () { init: function () {
// Setup accessibility // Setup accessibility
if (s.params.nextButton) { if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
var nextButton = $(s.params.nextButton); s.a11y.makeFocusable(s.nextButton);
s.a11y.makeFocusable(nextButton); s.a11y.addRole(s.nextButton, 'button');
s.a11y.addRole(nextButton, 'button'); s.a11y.addLabel(s.nextButton, s.params.nextSlideMessage);
s.a11y.addLabel(nextButton, s.params.nextSlideMessage);
} }
if (s.params.prevButton) { if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
var prevButton = $(s.params.prevButton); s.a11y.makeFocusable(s.prevButton);
s.a11y.makeFocusable(prevButton); s.a11y.addRole(s.prevButton, 'button');
s.a11y.addRole(prevButton, 'button'); s.a11y.addLabel(s.prevButton, s.params.prevSlideMessage);
s.a11y.addLabel(prevButton, s.params.prevSlideMessage);
} }
$(s.container).append(s.a11y.liveRegion); $(s.container).append(s.a11y.liveRegion);
@ -3711,3 +3775,4 @@ else if (typeof define === 'function' && define.amd) {
return window.Swiper; return window.Swiper;
}); });
} }
//# sourceMappingURL=maps/swiper.jquery.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/** /**
* Swiper 3.3.0 * Swiper 3.3.1
* Most modern mobile touch slider and framework with hardware accelerated transitions * Most modern mobile touch slider and framework with hardware accelerated transitions
* *
* http://www.idangero.us/swiper/ * http://www.idangero.us/swiper/
@ -10,7 +10,7 @@
* *
* Licensed under MIT * Licensed under MIT
* *
* Released on: January 10, 2016 * Released on: February 7, 2016
*/ */
(function (root, factory) { (function (root, factory) {
'use strict'; 'use strict';
@ -125,6 +125,8 @@
onlyExternal: false, onlyExternal: false,
threshold: 0, threshold: 0,
touchMoveStopPropagation: true, touchMoveStopPropagation: true,
// Unique Navigation Elements
uniqueNavElements: true,
// Pagination // Pagination
pagination: null, pagination: null,
paginationElement: 'span', paginationElement: 'span',
@ -313,10 +315,14 @@
var breakpoint = s.getActiveBreakpoint(); var breakpoint = s.getActiveBreakpoint();
if (breakpoint && s.currentBreakpoint !== breakpoint) { if (breakpoint && s.currentBreakpoint !== breakpoint) {
var breakPointsParams = breakpoint in s.params.breakpoints ? s.params.breakpoints[breakpoint] : s.originalParams; var breakPointsParams = breakpoint in s.params.breakpoints ? s.params.breakpoints[breakpoint] : s.originalParams;
var needsReLoop = s.params.loop && (breakPointsParams.slidesPerView !== s.params.slidesPerView);
for ( var param in breakPointsParams ) { for ( var param in breakPointsParams ) {
s.params[param] = breakPointsParams[param]; s.params[param] = breakPointsParams[param];
} }
s.currentBreakpoint = breakpoint; s.currentBreakpoint = breakpoint;
if(needsReLoop && s.destroyLoop) {
s.reLoop(true);
}
} }
}; };
// Set breakpoint on load // Set breakpoint on load
@ -330,10 +336,12 @@
s.container = $(container); s.container = $(container);
if (s.container.length === 0) return; if (s.container.length === 0) return;
if (s.container.length > 1) { if (s.container.length > 1) {
var swipers = [];
s.container.each(function () { s.container.each(function () {
new Swiper(this, params); var container = this;
swipers.push(new Swiper(this, params));
}); });
return; return swipers;
} }
// Save instance in container HTML Element and in data // Save instance in container HTML Element and in data
@ -402,6 +410,10 @@
// Pagination // Pagination
if (s.params.pagination) { if (s.params.pagination) {
s.paginationContainer = $(s.params.pagination); s.paginationContainer = $(s.params.pagination);
if (s.params.uniqueNavElements && typeof s.params.pagination === 'string' && s.paginationContainer.length > 1 && s.container.find(s.params.pagination).length === 1) {
s.paginationContainer = s.container.find(s.params.pagination);
}
if (s.params.paginationType === 'bullets' && s.params.paginationClickable) { if (s.params.paginationType === 'bullets' && s.params.paginationClickable) {
s.paginationContainer.addClass('swiper-pagination-clickable'); s.paginationContainer.addClass('swiper-pagination-clickable');
} }
@ -410,6 +422,21 @@
} }
s.paginationContainer.addClass('swiper-pagination-' + s.params.paginationType); s.paginationContainer.addClass('swiper-pagination-' + s.params.paginationType);
} }
// Next/Prev Buttons
if (s.params.nextButton || s.params.prevButton) {
if (s.params.nextButton) {
s.nextButton = $(s.params.nextButton);
if (s.params.uniqueNavElements && typeof s.params.nextButton === 'string' && s.nextButton.length > 1 && s.container.find(s.params.nextButton).length === 1) {
s.nextButton = s.container.find(s.params.nextButton);
}
}
if (s.params.prevButton) {
s.prevButton = $(s.params.prevButton);
if (s.params.uniqueNavElements && typeof s.params.prevButton === 'string' && s.prevButton.length > 1 && s.container.find(s.params.prevButton).length === 1) {
s.prevButton = s.container.find(s.params.prevButton);
}
}
}
// Is Horizontal // Is Horizontal
s.isHorizontal = function () { s.isHorizontal = function () {
@ -657,6 +684,7 @@
i, i,
prevSlideSize = 0, prevSlideSize = 0,
index = 0; index = 0;
if (typeof s.size === 'undefined') return;
if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) { if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * s.size; spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * s.size;
} }
@ -795,7 +823,7 @@
} }
} }
s.snapGrid = newSlidesGrid; s.snapGrid = newSlidesGrid;
if (Math.floor(s.virtualSize - s.size) > Math.floor(s.snapGrid[s.snapGrid.length - 1])) { if (Math.floor(s.virtualSize - s.size) - Math.floor(s.snapGrid[s.snapGrid.length - 1]) > 1) {
s.snapGrid.push(s.virtualSize - s.size); s.snapGrid.push(s.virtualSize - s.size);
} }
} }
@ -917,8 +945,16 @@
var activeSlide = s.slides.eq(s.activeIndex); var activeSlide = s.slides.eq(s.activeIndex);
// Active classes // Active classes
activeSlide.addClass(s.params.slideActiveClass); activeSlide.addClass(s.params.slideActiveClass);
activeSlide.next('.' + s.params.slideClass).addClass(s.params.slideNextClass); // Next Slide
activeSlide.prev('.' + s.params.slideClass).addClass(s.params.slidePrevClass); var nextSlide = activeSlide.next('.' + s.params.slideClass).addClass(s.params.slideNextClass);
if (s.params.loop && nextSlide.length === 0) {
s.slides.eq(0).addClass(s.params.slideNextClass);
}
// Prev Slide
var prevSlide = activeSlide.prev('.' + s.params.slideClass).addClass(s.params.slidePrevClass);
if (s.params.loop && prevSlide.length === 0) {
s.slides.eq(-1).addClass(s.params.slidePrevClass);
}
// Pagination // Pagination
if (s.paginationContainer && s.paginationContainer.length > 0) { if (s.paginationContainer && s.paginationContainer.length > 0) {
@ -926,7 +962,7 @@
var current, var current,
total = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length; total = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length;
if (s.params.loop) { if (s.params.loop) {
current = Math.ceil(s.activeIndex - s.loopedSlides)/s.params.slidesPerGroup; current = Math.ceil((s.activeIndex - s.loopedSlides)/s.params.slidesPerGroup);
if (current > s.slides.length - 1 - s.loopedSlides * 2) { if (current > s.slides.length - 1 - s.loopedSlides * 2) {
current = current - (s.slides.length - s.loopedSlides * 2); current = current - (s.slides.length - s.loopedSlides * 2);
} }
@ -969,29 +1005,30 @@
} }
if (s.params.paginationType === 'custom' && s.params.paginationCustomRender) { if (s.params.paginationType === 'custom' && s.params.paginationCustomRender) {
s.paginationContainer.html(s.params.paginationCustomRender(s, current + 1, total)); s.paginationContainer.html(s.params.paginationCustomRender(s, current + 1, total));
s.emit('onPaginationRendered', s, s.paginationContainer[0]);
} }
} }
// Next/active buttons // Next/active buttons
if (!s.params.loop) { if (!s.params.loop) {
if (s.params.prevButton) { if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
if (s.isBeginning) { if (s.isBeginning) {
$(s.params.prevButton).addClass(s.params.buttonDisabledClass); s.prevButton.addClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.disable($(s.params.prevButton)); if (s.params.a11y && s.a11y) s.a11y.disable(s.prevButton);
} }
else { else {
$(s.params.prevButton).removeClass(s.params.buttonDisabledClass); s.prevButton.removeClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.enable($(s.params.prevButton)); if (s.params.a11y && s.a11y) s.a11y.enable(s.prevButton);
} }
} }
if (s.params.nextButton) { if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
if (s.isEnd) { if (s.isEnd) {
$(s.params.nextButton).addClass(s.params.buttonDisabledClass); s.nextButton.addClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.disable($(s.params.nextButton)); if (s.params.a11y && s.a11y) s.a11y.disable(s.nextButton);
} }
else { else {
$(s.params.nextButton).removeClass(s.params.buttonDisabledClass); s.nextButton.removeClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.enable($(s.params.nextButton)); if (s.params.a11y && s.a11y) s.a11y.enable(s.nextButton);
} }
} }
} }
@ -1041,6 +1078,9 @@
} }
s.paginationContainer.html(paginationHTML); s.paginationContainer.html(paginationHTML);
} }
if (s.params.paginationType !== 'custom') {
s.emit('onPaginationRendered', s, s.paginationContainer[0]);
}
} }
}; };
/*========================= /*=========================
@ -1112,6 +1152,7 @@
if (s.controller && s.controller.spline) { if (s.controller && s.controller.spline) {
s.controller.spline = undefined; s.controller.spline = undefined;
} }
var slideChangedBySlideTo = false;
if (s.params.freeMode) { if (s.params.freeMode) {
var newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate()); var newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate());
s.setWrapperTranslate(newTranslate); s.setWrapperTranslate(newTranslate);
@ -1125,12 +1166,15 @@
else { else {
s.updateClasses(); s.updateClasses();
if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) { if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) {
s.slideTo(s.slides.length - 1, 0, false, true); slideChangedBySlideTo = s.slideTo(s.slides.length - 1, 0, false, true);
} }
else { else {
s.slideTo(s.activeIndex, 0, false, true); slideChangedBySlideTo = s.slideTo(s.activeIndex, 0, false, true);
} }
} }
if (s.params.lazyLoading && !slideChangedBySlideTo && s.lazy) {
s.lazy.load();
}
// Return locks after resize // Return locks after resize
s.params.allowSwipeToPrev = allowSwipeToPrev; s.params.allowSwipeToPrev = allowSwipeToPrev;
s.params.allowSwipeToNext = allowSwipeToNext; s.params.allowSwipeToNext = allowSwipeToNext;
@ -1186,23 +1230,23 @@
window[action]('resize', s.onResize); window[action]('resize', s.onResize);
// Next, Prev, Index // Next, Prev, Index
if (s.params.nextButton) { if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
$(s.params.nextButton)[actionDom]('click', s.onClickNext); s.nextButton[actionDom]('click', s.onClickNext);
if (s.params.a11y && s.a11y) $(s.params.nextButton)[actionDom]('keydown', s.a11y.onEnterKey); if (s.params.a11y && s.a11y) s.nextButton[actionDom]('keydown', s.a11y.onEnterKey);
} }
if (s.params.prevButton) { if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
$(s.params.prevButton)[actionDom]('click', s.onClickPrev); s.prevButton[actionDom]('click', s.onClickPrev);
if (s.params.a11y && s.a11y) $(s.params.prevButton)[actionDom]('keydown', s.a11y.onEnterKey); if (s.params.a11y && s.a11y) s.prevButton[actionDom]('keydown', s.a11y.onEnterKey);
} }
if (s.params.pagination && s.params.paginationClickable) { if (s.params.pagination && s.params.paginationClickable) {
$(s.paginationContainer)[actionDom]('click', '.' + s.params.bulletClass, s.onClickIndex); s.paginationContainer[actionDom]('click', '.' + s.params.bulletClass, s.onClickIndex);
if (s.params.a11y && s.a11y) $(s.paginationContainer)[actionDom]('keydown', '.' + s.params.bulletClass, s.a11y.onEnterKey); if (s.params.a11y && s.a11y) s.paginationContainer[actionDom]('keydown', '.' + s.params.bulletClass, s.a11y.onEnterKey);
} }
// Prevent Links Clicks // Prevent Links Clicks
if (s.params.preventClicks || s.params.preventClicksPropagation) touchEventsTarget[action]('click', s.preventClicks, true); if (s.params.preventClicks || s.params.preventClicksPropagation) touchEventsTarget[action]('click', s.preventClicks, true);
}; };
s.attachEvents = function (detach) { s.attachEvents = function () {
s.initEvents(); s.initEvents();
}; };
s.detachEvents = function () { s.detachEvents = function () {
@ -1398,7 +1442,11 @@
s.onTouchMove = function (e) { s.onTouchMove = function (e) {
if (e.originalEvent) e = e.originalEvent; if (e.originalEvent) e = e.originalEvent;
if (isTouchEvent && e.type === 'mousemove') return; if (isTouchEvent && e.type === 'mousemove') return;
if (e.preventedByNestedSwiper) return; if (e.preventedByNestedSwiper) {
s.touches.startX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
s.touches.startY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
return;
}
if (s.params.onlyExternal) { if (s.params.onlyExternal) {
// isMoved = true; // isMoved = true;
s.allowClick = false; s.allowClick = false;
@ -2163,6 +2211,16 @@
s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove(); s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove();
s.slides.removeAttr('data-swiper-slide-index'); s.slides.removeAttr('data-swiper-slide-index');
}; };
s.reLoop = function (updatePosition) {
var oldIndex = s.activeIndex - s.loopedSlides;
s.destroyLoop();
s.createLoop();
s.updateSlidesSize();
if (updatePosition) {
s.slideTo(oldIndex + s.loopedSlides, 0, false);
}
};
s.fixLoop = function () { s.fixLoop = function () {
var newIndex; var newIndex;
//Fix For Negative Oversliding //Fix For Negative Oversliding
@ -2570,7 +2628,7 @@
srcset = _img.attr('data-srcset'); srcset = _img.attr('data-srcset');
s.loadImage(_img[0], (src || background), srcset, false, function () { s.loadImage(_img[0], (src || background), srcset, false, function () {
if (background) { if (background) {
_img.css('background-image', 'url(' + background + ')'); _img.css('background-image', 'url("' + background + '")');
_img.removeAttr('data-background'); _img.removeAttr('data-background');
} }
else { else {
@ -2749,6 +2807,9 @@
if (!s.params.scrollbar) return; if (!s.params.scrollbar) return;
var sb = s.scrollbar; var sb = s.scrollbar;
sb.track = $(s.params.scrollbar); sb.track = $(s.params.scrollbar);
if (s.params.uniqueNavElements && typeof s.params.scrollbar === 'string' && sb.track.length > 1 && s.container.find(s.params.scrollbar).length === 1) {
sb.track = s.container.find(s.params.scrollbar);
}
sb.drag = sb.track.find('.swiper-scrollbar-drag'); sb.drag = sb.track.find('.swiper-scrollbar-drag');
if (sb.drag.length === 0) { if (sb.drag.length === 0) {
sb.drag = $('<div class="swiper-scrollbar-drag"></div>'); sb.drag = $('<div class="swiper-scrollbar-drag"></div>');
@ -3071,8 +3132,14 @@
try { try {
new window.WheelEvent('wheel'); new window.WheelEvent('wheel');
s.mousewheel.event = 'wheel'; s.mousewheel.event = 'wheel';
} catch (e) {} } catch (e) {
if (window.WheelEvent || (s.container[0] && 'wheel' in s.container[0])) {
s.mousewheel.event = 'wheel';
}
}
if (!s.mousewheel.event && window.WheelEvent) {
}
if (!s.mousewheel.event && document.onmousewheel !== undefined) { if (!s.mousewheel.event && document.onmousewheel !== undefined) {
s.mousewheel.event = 'mousewheel'; s.mousewheel.event = 'mousewheel';
} }
@ -3085,10 +3152,9 @@
var we = s.mousewheel.event; var we = s.mousewheel.event;
var delta = 0; var delta = 0;
var rtlFactor = s.rtl ? -1 : 1; var rtlFactor = s.rtl ? -1 : 1;
//Opera & IE
if (e.detail) delta = -e.detail;
//WebKits //WebKits
else if (we === 'mousewheel') { if (we === 'mousewheel') {
if (s.params.mousewheelForceToAxis) { if (s.params.mousewheelForceToAxis) {
if (s.isHorizontal()) { if (s.isHorizontal()) {
if (Math.abs(e.wheelDeltaX) > Math.abs(e.wheelDeltaY)) delta = e.wheelDeltaX * rtlFactor; if (Math.abs(e.wheelDeltaX) > Math.abs(e.wheelDeltaY)) delta = e.wheelDeltaX * rtlFactor;
@ -3398,17 +3464,15 @@
}, },
init: function () { init: function () {
// Setup accessibility // Setup accessibility
if (s.params.nextButton) { if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
var nextButton = $(s.params.nextButton); s.a11y.makeFocusable(s.nextButton);
s.a11y.makeFocusable(nextButton); s.a11y.addRole(s.nextButton, 'button');
s.a11y.addRole(nextButton, 'button'); s.a11y.addLabel(s.nextButton, s.params.nextSlideMessage);
s.a11y.addLabel(nextButton, s.params.nextSlideMessage);
} }
if (s.params.prevButton) { if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
var prevButton = $(s.params.prevButton); s.a11y.makeFocusable(s.prevButton);
s.a11y.makeFocusable(prevButton); s.a11y.addRole(s.prevButton, 'button');
s.a11y.addRole(prevButton, 'button'); s.a11y.addLabel(s.prevButton, s.params.prevSlideMessage);
s.a11y.addLabel(prevButton, s.params.prevSlideMessage);
} }
$(s.container).append(s.a11y.liveRegion); $(s.container).append(s.a11y.liveRegion);
@ -3703,3 +3767,4 @@
return Swiper; return Swiper;
})); }));
//# sourceMappingURL=maps/swiper.jquery.umd.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/** /**
* Swiper 3.3.0 * Swiper 3.3.1
* Most modern mobile touch slider and framework with hardware accelerated transitions * Most modern mobile touch slider and framework with hardware accelerated transitions
* *
* http://www.idangero.us/swiper/ * http://www.idangero.us/swiper/
@ -10,7 +10,7 @@
* *
* Licensed under MIT * Licensed under MIT
* *
* Released on: January 10, 2016 * Released on: February 7, 2016
*/ */
(function () { (function () {
'use strict'; 'use strict';
@ -110,6 +110,8 @@
onlyExternal: false, onlyExternal: false,
threshold: 0, threshold: 0,
touchMoveStopPropagation: true, touchMoveStopPropagation: true,
// Unique Navigation Elements
uniqueNavElements: true,
// Pagination // Pagination
pagination: null, pagination: null,
paginationElement: 'span', paginationElement: 'span',
@ -298,10 +300,14 @@
var breakpoint = s.getActiveBreakpoint(); var breakpoint = s.getActiveBreakpoint();
if (breakpoint && s.currentBreakpoint !== breakpoint) { if (breakpoint && s.currentBreakpoint !== breakpoint) {
var breakPointsParams = breakpoint in s.params.breakpoints ? s.params.breakpoints[breakpoint] : s.originalParams; var breakPointsParams = breakpoint in s.params.breakpoints ? s.params.breakpoints[breakpoint] : s.originalParams;
var needsReLoop = s.params.loop && (breakPointsParams.slidesPerView !== s.params.slidesPerView);
for ( var param in breakPointsParams ) { for ( var param in breakPointsParams ) {
s.params[param] = breakPointsParams[param]; s.params[param] = breakPointsParams[param];
} }
s.currentBreakpoint = breakpoint; s.currentBreakpoint = breakpoint;
if(needsReLoop && s.destroyLoop) {
s.reLoop(true);
}
} }
}; };
// Set breakpoint on load // Set breakpoint on load
@ -315,10 +321,12 @@
s.container = $(container); s.container = $(container);
if (s.container.length === 0) return; if (s.container.length === 0) return;
if (s.container.length > 1) { if (s.container.length > 1) {
var swipers = [];
s.container.each(function () { s.container.each(function () {
new Swiper(this, params); var container = this;
swipers.push(new Swiper(this, params));
}); });
return; return swipers;
} }
// Save instance in container HTML Element and in data // Save instance in container HTML Element and in data
@ -387,6 +395,10 @@
// Pagination // Pagination
if (s.params.pagination) { if (s.params.pagination) {
s.paginationContainer = $(s.params.pagination); s.paginationContainer = $(s.params.pagination);
if (s.params.uniqueNavElements && typeof s.params.pagination === 'string' && s.paginationContainer.length > 1 && s.container.find(s.params.pagination).length === 1) {
s.paginationContainer = s.container.find(s.params.pagination);
}
if (s.params.paginationType === 'bullets' && s.params.paginationClickable) { if (s.params.paginationType === 'bullets' && s.params.paginationClickable) {
s.paginationContainer.addClass('swiper-pagination-clickable'); s.paginationContainer.addClass('swiper-pagination-clickable');
} }
@ -395,6 +407,21 @@
} }
s.paginationContainer.addClass('swiper-pagination-' + s.params.paginationType); s.paginationContainer.addClass('swiper-pagination-' + s.params.paginationType);
} }
// Next/Prev Buttons
if (s.params.nextButton || s.params.prevButton) {
if (s.params.nextButton) {
s.nextButton = $(s.params.nextButton);
if (s.params.uniqueNavElements && typeof s.params.nextButton === 'string' && s.nextButton.length > 1 && s.container.find(s.params.nextButton).length === 1) {
s.nextButton = s.container.find(s.params.nextButton);
}
}
if (s.params.prevButton) {
s.prevButton = $(s.params.prevButton);
if (s.params.uniqueNavElements && typeof s.params.prevButton === 'string' && s.prevButton.length > 1 && s.container.find(s.params.prevButton).length === 1) {
s.prevButton = s.container.find(s.params.prevButton);
}
}
}
// Is Horizontal // Is Horizontal
s.isHorizontal = function () { s.isHorizontal = function () {
@ -642,6 +669,7 @@
i, i,
prevSlideSize = 0, prevSlideSize = 0,
index = 0; index = 0;
if (typeof s.size === 'undefined') return;
if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) { if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * s.size; spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * s.size;
} }
@ -780,7 +808,7 @@
} }
} }
s.snapGrid = newSlidesGrid; s.snapGrid = newSlidesGrid;
if (Math.floor(s.virtualSize - s.size) > Math.floor(s.snapGrid[s.snapGrid.length - 1])) { if (Math.floor(s.virtualSize - s.size) - Math.floor(s.snapGrid[s.snapGrid.length - 1]) > 1) {
s.snapGrid.push(s.virtualSize - s.size); s.snapGrid.push(s.virtualSize - s.size);
} }
} }
@ -902,8 +930,16 @@
var activeSlide = s.slides.eq(s.activeIndex); var activeSlide = s.slides.eq(s.activeIndex);
// Active classes // Active classes
activeSlide.addClass(s.params.slideActiveClass); activeSlide.addClass(s.params.slideActiveClass);
activeSlide.next('.' + s.params.slideClass).addClass(s.params.slideNextClass); // Next Slide
activeSlide.prev('.' + s.params.slideClass).addClass(s.params.slidePrevClass); var nextSlide = activeSlide.next('.' + s.params.slideClass).addClass(s.params.slideNextClass);
if (s.params.loop && nextSlide.length === 0) {
s.slides.eq(0).addClass(s.params.slideNextClass);
}
// Prev Slide
var prevSlide = activeSlide.prev('.' + s.params.slideClass).addClass(s.params.slidePrevClass);
if (s.params.loop && prevSlide.length === 0) {
s.slides.eq(-1).addClass(s.params.slidePrevClass);
}
// Pagination // Pagination
if (s.paginationContainer && s.paginationContainer.length > 0) { if (s.paginationContainer && s.paginationContainer.length > 0) {
@ -911,7 +947,7 @@
var current, var current,
total = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length; total = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length;
if (s.params.loop) { if (s.params.loop) {
current = Math.ceil(s.activeIndex - s.loopedSlides)/s.params.slidesPerGroup; current = Math.ceil((s.activeIndex - s.loopedSlides)/s.params.slidesPerGroup);
if (current > s.slides.length - 1 - s.loopedSlides * 2) { if (current > s.slides.length - 1 - s.loopedSlides * 2) {
current = current - (s.slides.length - s.loopedSlides * 2); current = current - (s.slides.length - s.loopedSlides * 2);
} }
@ -954,29 +990,30 @@
} }
if (s.params.paginationType === 'custom' && s.params.paginationCustomRender) { if (s.params.paginationType === 'custom' && s.params.paginationCustomRender) {
s.paginationContainer.html(s.params.paginationCustomRender(s, current + 1, total)); s.paginationContainer.html(s.params.paginationCustomRender(s, current + 1, total));
s.emit('onPaginationRendered', s, s.paginationContainer[0]);
} }
} }
// Next/active buttons // Next/active buttons
if (!s.params.loop) { if (!s.params.loop) {
if (s.params.prevButton) { if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
if (s.isBeginning) { if (s.isBeginning) {
$(s.params.prevButton).addClass(s.params.buttonDisabledClass); s.prevButton.addClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.disable($(s.params.prevButton)); if (s.params.a11y && s.a11y) s.a11y.disable(s.prevButton);
} }
else { else {
$(s.params.prevButton).removeClass(s.params.buttonDisabledClass); s.prevButton.removeClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.enable($(s.params.prevButton)); if (s.params.a11y && s.a11y) s.a11y.enable(s.prevButton);
} }
} }
if (s.params.nextButton) { if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
if (s.isEnd) { if (s.isEnd) {
$(s.params.nextButton).addClass(s.params.buttonDisabledClass); s.nextButton.addClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.disable($(s.params.nextButton)); if (s.params.a11y && s.a11y) s.a11y.disable(s.nextButton);
} }
else { else {
$(s.params.nextButton).removeClass(s.params.buttonDisabledClass); s.nextButton.removeClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.enable($(s.params.nextButton)); if (s.params.a11y && s.a11y) s.a11y.enable(s.nextButton);
} }
} }
} }
@ -1026,6 +1063,9 @@
} }
s.paginationContainer.html(paginationHTML); s.paginationContainer.html(paginationHTML);
} }
if (s.params.paginationType !== 'custom') {
s.emit('onPaginationRendered', s, s.paginationContainer[0]);
}
} }
}; };
/*========================= /*=========================
@ -1097,6 +1137,7 @@
if (s.controller && s.controller.spline) { if (s.controller && s.controller.spline) {
s.controller.spline = undefined; s.controller.spline = undefined;
} }
var slideChangedBySlideTo = false;
if (s.params.freeMode) { if (s.params.freeMode) {
var newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate()); var newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate());
s.setWrapperTranslate(newTranslate); s.setWrapperTranslate(newTranslate);
@ -1110,12 +1151,15 @@
else { else {
s.updateClasses(); s.updateClasses();
if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) { if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) {
s.slideTo(s.slides.length - 1, 0, false, true); slideChangedBySlideTo = s.slideTo(s.slides.length - 1, 0, false, true);
} }
else { else {
s.slideTo(s.activeIndex, 0, false, true); slideChangedBySlideTo = s.slideTo(s.activeIndex, 0, false, true);
} }
} }
if (s.params.lazyLoading && !slideChangedBySlideTo && s.lazy) {
s.lazy.load();
}
// Return locks after resize // Return locks after resize
s.params.allowSwipeToPrev = allowSwipeToPrev; s.params.allowSwipeToPrev = allowSwipeToPrev;
s.params.allowSwipeToNext = allowSwipeToNext; s.params.allowSwipeToNext = allowSwipeToNext;
@ -1171,23 +1215,23 @@
window[action]('resize', s.onResize); window[action]('resize', s.onResize);
// Next, Prev, Index // Next, Prev, Index
if (s.params.nextButton) { if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
$(s.params.nextButton)[actionDom]('click', s.onClickNext); s.nextButton[actionDom]('click', s.onClickNext);
if (s.params.a11y && s.a11y) $(s.params.nextButton)[actionDom]('keydown', s.a11y.onEnterKey); if (s.params.a11y && s.a11y) s.nextButton[actionDom]('keydown', s.a11y.onEnterKey);
} }
if (s.params.prevButton) { if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
$(s.params.prevButton)[actionDom]('click', s.onClickPrev); s.prevButton[actionDom]('click', s.onClickPrev);
if (s.params.a11y && s.a11y) $(s.params.prevButton)[actionDom]('keydown', s.a11y.onEnterKey); if (s.params.a11y && s.a11y) s.prevButton[actionDom]('keydown', s.a11y.onEnterKey);
} }
if (s.params.pagination && s.params.paginationClickable) { if (s.params.pagination && s.params.paginationClickable) {
$(s.paginationContainer)[actionDom]('click', '.' + s.params.bulletClass, s.onClickIndex); s.paginationContainer[actionDom]('click', '.' + s.params.bulletClass, s.onClickIndex);
if (s.params.a11y && s.a11y) $(s.paginationContainer)[actionDom]('keydown', '.' + s.params.bulletClass, s.a11y.onEnterKey); if (s.params.a11y && s.a11y) s.paginationContainer[actionDom]('keydown', '.' + s.params.bulletClass, s.a11y.onEnterKey);
} }
// Prevent Links Clicks // Prevent Links Clicks
if (s.params.preventClicks || s.params.preventClicksPropagation) touchEventsTarget[action]('click', s.preventClicks, true); if (s.params.preventClicks || s.params.preventClicksPropagation) touchEventsTarget[action]('click', s.preventClicks, true);
}; };
s.attachEvents = function (detach) { s.attachEvents = function () {
s.initEvents(); s.initEvents();
}; };
s.detachEvents = function () { s.detachEvents = function () {
@ -1383,7 +1427,11 @@
s.onTouchMove = function (e) { s.onTouchMove = function (e) {
if (e.originalEvent) e = e.originalEvent; if (e.originalEvent) e = e.originalEvent;
if (isTouchEvent && e.type === 'mousemove') return; if (isTouchEvent && e.type === 'mousemove') return;
if (e.preventedByNestedSwiper) return; if (e.preventedByNestedSwiper) {
s.touches.startX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
s.touches.startY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
return;
}
if (s.params.onlyExternal) { if (s.params.onlyExternal) {
// isMoved = true; // isMoved = true;
s.allowClick = false; s.allowClick = false;
@ -2148,6 +2196,16 @@
s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove(); s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove();
s.slides.removeAttr('data-swiper-slide-index'); s.slides.removeAttr('data-swiper-slide-index');
}; };
s.reLoop = function (updatePosition) {
var oldIndex = s.activeIndex - s.loopedSlides;
s.destroyLoop();
s.createLoop();
s.updateSlidesSize();
if (updatePosition) {
s.slideTo(oldIndex + s.loopedSlides, 0, false);
}
};
s.fixLoop = function () { s.fixLoop = function () {
var newIndex; var newIndex;
//Fix For Negative Oversliding //Fix For Negative Oversliding
@ -2555,7 +2613,7 @@
srcset = _img.attr('data-srcset'); srcset = _img.attr('data-srcset');
s.loadImage(_img[0], (src || background), srcset, false, function () { s.loadImage(_img[0], (src || background), srcset, false, function () {
if (background) { if (background) {
_img.css('background-image', 'url(' + background + ')'); _img.css('background-image', 'url("' + background + '")');
_img.removeAttr('data-background'); _img.removeAttr('data-background');
} }
else { else {
@ -2734,6 +2792,9 @@
if (!s.params.scrollbar) return; if (!s.params.scrollbar) return;
var sb = s.scrollbar; var sb = s.scrollbar;
sb.track = $(s.params.scrollbar); sb.track = $(s.params.scrollbar);
if (s.params.uniqueNavElements && typeof s.params.scrollbar === 'string' && sb.track.length > 1 && s.container.find(s.params.scrollbar).length === 1) {
sb.track = s.container.find(s.params.scrollbar);
}
sb.drag = sb.track.find('.swiper-scrollbar-drag'); sb.drag = sb.track.find('.swiper-scrollbar-drag');
if (sb.drag.length === 0) { if (sb.drag.length === 0) {
sb.drag = $('<div class="swiper-scrollbar-drag"></div>'); sb.drag = $('<div class="swiper-scrollbar-drag"></div>');
@ -3056,8 +3117,14 @@
try { try {
new window.WheelEvent('wheel'); new window.WheelEvent('wheel');
s.mousewheel.event = 'wheel'; s.mousewheel.event = 'wheel';
} catch (e) {} } catch (e) {
if (window.WheelEvent || (s.container[0] && 'wheel' in s.container[0])) {
s.mousewheel.event = 'wheel';
}
}
if (!s.mousewheel.event && window.WheelEvent) {
}
if (!s.mousewheel.event && document.onmousewheel !== undefined) { if (!s.mousewheel.event && document.onmousewheel !== undefined) {
s.mousewheel.event = 'mousewheel'; s.mousewheel.event = 'mousewheel';
} }
@ -3070,10 +3137,9 @@
var we = s.mousewheel.event; var we = s.mousewheel.event;
var delta = 0; var delta = 0;
var rtlFactor = s.rtl ? -1 : 1; var rtlFactor = s.rtl ? -1 : 1;
//Opera & IE
if (e.detail) delta = -e.detail;
//WebKits //WebKits
else if (we === 'mousewheel') { if (we === 'mousewheel') {
if (s.params.mousewheelForceToAxis) { if (s.params.mousewheelForceToAxis) {
if (s.isHorizontal()) { if (s.isHorizontal()) {
if (Math.abs(e.wheelDeltaX) > Math.abs(e.wheelDeltaY)) delta = e.wheelDeltaX * rtlFactor; if (Math.abs(e.wheelDeltaX) > Math.abs(e.wheelDeltaY)) delta = e.wheelDeltaX * rtlFactor;
@ -3383,17 +3449,15 @@
}, },
init: function () { init: function () {
// Setup accessibility // Setup accessibility
if (s.params.nextButton) { if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
var nextButton = $(s.params.nextButton); s.a11y.makeFocusable(s.nextButton);
s.a11y.makeFocusable(nextButton); s.a11y.addRole(s.nextButton, 'button');
s.a11y.addRole(nextButton, 'button'); s.a11y.addLabel(s.nextButton, s.params.nextSlideMessage);
s.a11y.addLabel(nextButton, s.params.nextSlideMessage);
} }
if (s.params.prevButton) { if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
var prevButton = $(s.params.prevButton); s.a11y.makeFocusable(s.prevButton);
s.a11y.makeFocusable(prevButton); s.a11y.addRole(s.prevButton, 'button');
s.a11y.addRole(prevButton, 'button'); s.a11y.addLabel(s.prevButton, s.params.prevSlideMessage);
s.a11y.addLabel(prevButton, s.params.prevSlideMessage);
} }
$(s.container).append(s.a11y.liveRegion); $(s.container).append(s.a11y.liveRegion);
@ -4377,3 +4441,4 @@ else if (typeof define === 'function' && define.amd) {
return window.Swiper; return window.Swiper;
}); });
} }
//# sourceMappingURL=maps/swiper.js.map

File diff suppressed because one or more lines are too long

View file

@ -170,32 +170,41 @@
.pipe(tap(function (file, t){ .pipe(tap(function (file, t){
addJSIndent (file, t); addJSIndent (file, t);
})) }))
.pipe(sourcemaps.init())
.pipe(concat(swiper.filename + '.js')) .pipe(concat(swiper.filename + '.js'))
.pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date } )) .pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date } ))
.pipe(gulp.dest(paths.build.scripts))
.pipe(jshint()) .pipe(jshint())
.pipe(jshint.reporter(stylish)); .pipe(jshint.reporter(stylish))
.pipe(sourcemaps.write('./maps/'))
.pipe(gulp.dest(paths.build.scripts));
gulp.src(swiper.jQueryFiles) gulp.src(swiper.jQueryFiles)
.pipe(tap(function (file, t){ .pipe(tap(function (file, t){
addJSIndent (file, t); addJSIndent (file, t);
})) }))
.pipe(sourcemaps.init())
.pipe(concat(swiper.filename + '.jquery.js')) .pipe(concat(swiper.filename + '.jquery.js'))
.pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date } )) .pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date } ))
.pipe(sourcemaps.write('./maps/'))
.pipe(gulp.dest(paths.build.scripts)); .pipe(gulp.dest(paths.build.scripts));
gulp.src(swiper.jQueryUMDFiles) gulp.src(swiper.jQueryUMDFiles)
.pipe(tap(function (file, t){ .pipe(tap(function (file, t){
addJSIndent (file, t); addJSIndent (file, t);
})) }))
.pipe(sourcemaps.init())
.pipe(concat(swiper.filename + '.jquery.umd.js')) .pipe(concat(swiper.filename + '.jquery.umd.js'))
.pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date } )) .pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date } ))
.pipe(sourcemaps.write('./maps/'))
.pipe(gulp.dest(paths.build.scripts)); .pipe(gulp.dest(paths.build.scripts));
gulp.src(swiper.Framework7Files) gulp.src(swiper.Framework7Files)
.pipe(tap(function (file, t){ .pipe(tap(function (file, t){
addJSIndent (file, t, true); addJSIndent (file, t, true);
})) }))
.pipe(sourcemaps.init())
.pipe(concat(swiper.filename + '.framework7.js')) .pipe(concat(swiper.filename + '.framework7.js'))
.pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date } )) .pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date } ))
.pipe(sourcemaps.write('./maps/'))
.pipe(gulp.dest(paths.build.scripts)) .pipe(gulp.dest(paths.build.scripts))
.pipe(connect.reload()); .pipe(connect.reload());
cb(); cb();

View file

@ -1,4 +1,4 @@
var version = '3.3.0'; var version = '3.3.1';
Package.describe({ Package.describe({
name: 'nolimits4web:swiper', name: 'nolimits4web:swiper',

View file

@ -59,17 +59,15 @@ s.a11y = {
}, },
init: function () { init: function () {
// Setup accessibility // Setup accessibility
if (s.params.nextButton) { if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
var nextButton = $(s.params.nextButton); s.a11y.makeFocusable(s.nextButton);
s.a11y.makeFocusable(nextButton); s.a11y.addRole(s.nextButton, 'button');
s.a11y.addRole(nextButton, 'button'); s.a11y.addLabel(s.nextButton, s.params.nextSlideMessage);
s.a11y.addLabel(nextButton, s.params.nextSlideMessage);
} }
if (s.params.prevButton) { if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
var prevButton = $(s.params.prevButton); s.a11y.makeFocusable(s.prevButton);
s.a11y.makeFocusable(prevButton); s.a11y.addRole(s.prevButton, 'button');
s.a11y.addRole(prevButton, 'button'); s.a11y.addLabel(s.prevButton, s.params.prevSlideMessage);
s.a11y.addLabel(prevButton, s.params.prevSlideMessage);
} }
$(s.container).append(s.a11y.liveRegion); $(s.container).append(s.a11y.liveRegion);

View file

@ -87,6 +87,8 @@ var defaults = {
onlyExternal: false, onlyExternal: false,
threshold: 0, threshold: 0,
touchMoveStopPropagation: true, touchMoveStopPropagation: true,
// Unique Navigation Elements
uniqueNavElements: true,
// Pagination // Pagination
pagination: null, pagination: null,
paginationElement: 'span', paginationElement: 'span',
@ -275,10 +277,14 @@ s.setBreakpoint = function () {
var breakpoint = s.getActiveBreakpoint(); var breakpoint = s.getActiveBreakpoint();
if (breakpoint && s.currentBreakpoint !== breakpoint) { if (breakpoint && s.currentBreakpoint !== breakpoint) {
var breakPointsParams = breakpoint in s.params.breakpoints ? s.params.breakpoints[breakpoint] : s.originalParams; var breakPointsParams = breakpoint in s.params.breakpoints ? s.params.breakpoints[breakpoint] : s.originalParams;
var needsReLoop = s.params.loop && (breakPointsParams.slidesPerView !== s.params.slidesPerView);
for ( var param in breakPointsParams ) { for ( var param in breakPointsParams ) {
s.params[param] = breakPointsParams[param]; s.params[param] = breakPointsParams[param];
} }
s.currentBreakpoint = breakpoint; s.currentBreakpoint = breakpoint;
if(needsReLoop && s.destroyLoop) {
s.reLoop(true);
}
} }
}; };
// Set breakpoint on load // Set breakpoint on load
@ -292,10 +298,12 @@ if (s.params.breakpoints) {
s.container = $(container); s.container = $(container);
if (s.container.length === 0) return; if (s.container.length === 0) return;
if (s.container.length > 1) { if (s.container.length > 1) {
var swipers = [];
s.container.each(function () { s.container.each(function () {
new Swiper(this, params); var container = this;
swipers.push(new Swiper(this, params));
}); });
return; return swipers;
} }
// Save instance in container HTML Element and in data // Save instance in container HTML Element and in data
@ -364,6 +372,10 @@ s.wrapper = s.container.children('.' + s.params.wrapperClass);
// Pagination // Pagination
if (s.params.pagination) { if (s.params.pagination) {
s.paginationContainer = $(s.params.pagination); s.paginationContainer = $(s.params.pagination);
if (s.params.uniqueNavElements && typeof s.params.pagination === 'string' && s.paginationContainer.length > 1 && s.container.find(s.params.pagination).length === 1) {
s.paginationContainer = s.container.find(s.params.pagination);
}
if (s.params.paginationType === 'bullets' && s.params.paginationClickable) { if (s.params.paginationType === 'bullets' && s.params.paginationClickable) {
s.paginationContainer.addClass('swiper-pagination-clickable'); s.paginationContainer.addClass('swiper-pagination-clickable');
} }
@ -372,6 +384,21 @@ if (s.params.pagination) {
} }
s.paginationContainer.addClass('swiper-pagination-' + s.params.paginationType); s.paginationContainer.addClass('swiper-pagination-' + s.params.paginationType);
} }
// Next/Prev Buttons
if (s.params.nextButton || s.params.prevButton) {
if (s.params.nextButton) {
s.nextButton = $(s.params.nextButton);
if (s.params.uniqueNavElements && typeof s.params.nextButton === 'string' && s.nextButton.length > 1 && s.container.find(s.params.nextButton).length === 1) {
s.nextButton = s.container.find(s.params.nextButton);
}
}
if (s.params.prevButton) {
s.prevButton = $(s.params.prevButton);
if (s.params.uniqueNavElements && typeof s.params.prevButton === 'string' && s.prevButton.length > 1 && s.container.find(s.params.prevButton).length === 1) {
s.prevButton = s.container.find(s.params.prevButton);
}
}
}
// Is Horizontal // Is Horizontal
s.isHorizontal = function () { s.isHorizontal = function () {
@ -619,6 +646,7 @@ s.updateSlidesSize = function () {
i, i,
prevSlideSize = 0, prevSlideSize = 0,
index = 0; index = 0;
if (typeof s.size === 'undefined') return;
if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) { if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * s.size; spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * s.size;
} }
@ -757,7 +785,7 @@ s.updateSlidesSize = function () {
} }
} }
s.snapGrid = newSlidesGrid; s.snapGrid = newSlidesGrid;
if (Math.floor(s.virtualSize - s.size) > Math.floor(s.snapGrid[s.snapGrid.length - 1])) { if (Math.floor(s.virtualSize - s.size) - Math.floor(s.snapGrid[s.snapGrid.length - 1]) > 1) {
s.snapGrid.push(s.virtualSize - s.size); s.snapGrid.push(s.virtualSize - s.size);
} }
} }
@ -879,8 +907,16 @@ s.updateClasses = function () {
var activeSlide = s.slides.eq(s.activeIndex); var activeSlide = s.slides.eq(s.activeIndex);
// Active classes // Active classes
activeSlide.addClass(s.params.slideActiveClass); activeSlide.addClass(s.params.slideActiveClass);
activeSlide.next('.' + s.params.slideClass).addClass(s.params.slideNextClass); // Next Slide
activeSlide.prev('.' + s.params.slideClass).addClass(s.params.slidePrevClass); var nextSlide = activeSlide.next('.' + s.params.slideClass).addClass(s.params.slideNextClass);
if (s.params.loop && nextSlide.length === 0) {
s.slides.eq(0).addClass(s.params.slideNextClass);
}
// Prev Slide
var prevSlide = activeSlide.prev('.' + s.params.slideClass).addClass(s.params.slidePrevClass);
if (s.params.loop && prevSlide.length === 0) {
s.slides.eq(-1).addClass(s.params.slidePrevClass);
}
// Pagination // Pagination
if (s.paginationContainer && s.paginationContainer.length > 0) { if (s.paginationContainer && s.paginationContainer.length > 0) {
@ -888,7 +924,7 @@ s.updateClasses = function () {
var current, var current,
total = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length; total = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length;
if (s.params.loop) { if (s.params.loop) {
current = Math.ceil(s.activeIndex - s.loopedSlides)/s.params.slidesPerGroup; current = Math.ceil((s.activeIndex - s.loopedSlides)/s.params.slidesPerGroup);
if (current > s.slides.length - 1 - s.loopedSlides * 2) { if (current > s.slides.length - 1 - s.loopedSlides * 2) {
current = current - (s.slides.length - s.loopedSlides * 2); current = current - (s.slides.length - s.loopedSlides * 2);
} }
@ -931,29 +967,30 @@ s.updateClasses = function () {
} }
if (s.params.paginationType === 'custom' && s.params.paginationCustomRender) { if (s.params.paginationType === 'custom' && s.params.paginationCustomRender) {
s.paginationContainer.html(s.params.paginationCustomRender(s, current + 1, total)); s.paginationContainer.html(s.params.paginationCustomRender(s, current + 1, total));
s.emit('onPaginationRendered', s, s.paginationContainer[0]);
} }
} }
// Next/active buttons // Next/active buttons
if (!s.params.loop) { if (!s.params.loop) {
if (s.params.prevButton) { if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
if (s.isBeginning) { if (s.isBeginning) {
$(s.params.prevButton).addClass(s.params.buttonDisabledClass); s.prevButton.addClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.disable($(s.params.prevButton)); if (s.params.a11y && s.a11y) s.a11y.disable(s.prevButton);
} }
else { else {
$(s.params.prevButton).removeClass(s.params.buttonDisabledClass); s.prevButton.removeClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.enable($(s.params.prevButton)); if (s.params.a11y && s.a11y) s.a11y.enable(s.prevButton);
} }
} }
if (s.params.nextButton) { if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
if (s.isEnd) { if (s.isEnd) {
$(s.params.nextButton).addClass(s.params.buttonDisabledClass); s.nextButton.addClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.disable($(s.params.nextButton)); if (s.params.a11y && s.a11y) s.a11y.disable(s.nextButton);
} }
else { else {
$(s.params.nextButton).removeClass(s.params.buttonDisabledClass); s.nextButton.removeClass(s.params.buttonDisabledClass);
if (s.params.a11y && s.a11y) s.a11y.enable($(s.params.nextButton)); if (s.params.a11y && s.a11y) s.a11y.enable(s.nextButton);
} }
} }
} }
@ -1003,6 +1040,9 @@ s.updatePagination = function () {
} }
s.paginationContainer.html(paginationHTML); s.paginationContainer.html(paginationHTML);
} }
if (s.params.paginationType !== 'custom') {
s.emit('onPaginationRendered', s, s.paginationContainer[0]);
}
} }
}; };
/*========================= /*=========================
@ -1074,6 +1114,7 @@ s.onResize = function (forceUpdatePagination) {
if (s.controller && s.controller.spline) { if (s.controller && s.controller.spline) {
s.controller.spline = undefined; s.controller.spline = undefined;
} }
var slideChangedBySlideTo = false;
if (s.params.freeMode) { if (s.params.freeMode) {
var newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate()); var newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate());
s.setWrapperTranslate(newTranslate); s.setWrapperTranslate(newTranslate);
@ -1087,12 +1128,15 @@ s.onResize = function (forceUpdatePagination) {
else { else {
s.updateClasses(); s.updateClasses();
if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) { if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) {
s.slideTo(s.slides.length - 1, 0, false, true); slideChangedBySlideTo = s.slideTo(s.slides.length - 1, 0, false, true);
} }
else { else {
s.slideTo(s.activeIndex, 0, false, true); slideChangedBySlideTo = s.slideTo(s.activeIndex, 0, false, true);
} }
} }
if (s.params.lazyLoading && !slideChangedBySlideTo && s.lazy) {
s.lazy.load();
}
// Return locks after resize // Return locks after resize
s.params.allowSwipeToPrev = allowSwipeToPrev; s.params.allowSwipeToPrev = allowSwipeToPrev;
s.params.allowSwipeToNext = allowSwipeToNext; s.params.allowSwipeToNext = allowSwipeToNext;
@ -1148,23 +1192,23 @@ s.initEvents = function (detach) {
window[action]('resize', s.onResize); window[action]('resize', s.onResize);
// Next, Prev, Index // Next, Prev, Index
if (s.params.nextButton) { if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
$(s.params.nextButton)[actionDom]('click', s.onClickNext); s.nextButton[actionDom]('click', s.onClickNext);
if (s.params.a11y && s.a11y) $(s.params.nextButton)[actionDom]('keydown', s.a11y.onEnterKey); if (s.params.a11y && s.a11y) s.nextButton[actionDom]('keydown', s.a11y.onEnterKey);
} }
if (s.params.prevButton) { if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
$(s.params.prevButton)[actionDom]('click', s.onClickPrev); s.prevButton[actionDom]('click', s.onClickPrev);
if (s.params.a11y && s.a11y) $(s.params.prevButton)[actionDom]('keydown', s.a11y.onEnterKey); if (s.params.a11y && s.a11y) s.prevButton[actionDom]('keydown', s.a11y.onEnterKey);
} }
if (s.params.pagination && s.params.paginationClickable) { if (s.params.pagination && s.params.paginationClickable) {
$(s.paginationContainer)[actionDom]('click', '.' + s.params.bulletClass, s.onClickIndex); s.paginationContainer[actionDom]('click', '.' + s.params.bulletClass, s.onClickIndex);
if (s.params.a11y && s.a11y) $(s.paginationContainer)[actionDom]('keydown', '.' + s.params.bulletClass, s.a11y.onEnterKey); if (s.params.a11y && s.a11y) s.paginationContainer[actionDom]('keydown', '.' + s.params.bulletClass, s.a11y.onEnterKey);
} }
// Prevent Links Clicks // Prevent Links Clicks
if (s.params.preventClicks || s.params.preventClicksPropagation) touchEventsTarget[action]('click', s.preventClicks, true); if (s.params.preventClicks || s.params.preventClicksPropagation) touchEventsTarget[action]('click', s.preventClicks, true);
}; };
s.attachEvents = function (detach) { s.attachEvents = function () {
s.initEvents(); s.initEvents();
}; };
s.detachEvents = function () { s.detachEvents = function () {
@ -1360,7 +1404,11 @@ s.onTouchStart = function (e) {
s.onTouchMove = function (e) { s.onTouchMove = function (e) {
if (e.originalEvent) e = e.originalEvent; if (e.originalEvent) e = e.originalEvent;
if (isTouchEvent && e.type === 'mousemove') return; if (isTouchEvent && e.type === 'mousemove') return;
if (e.preventedByNestedSwiper) return; if (e.preventedByNestedSwiper) {
s.touches.startX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
s.touches.startY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
return;
}
if (s.params.onlyExternal) { if (s.params.onlyExternal) {
// isMoved = true; // isMoved = true;
s.allowClick = false; s.allowClick = false;
@ -2125,6 +2173,16 @@ s.destroyLoop = function () {
s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove(); s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove();
s.slides.removeAttr('data-swiper-slide-index'); s.slides.removeAttr('data-swiper-slide-index');
}; };
s.reLoop = function (updatePosition) {
var oldIndex = s.activeIndex - s.loopedSlides;
s.destroyLoop();
s.createLoop();
s.updateSlidesSize();
if (updatePosition) {
s.slideTo(oldIndex + s.loopedSlides, 0, false);
}
};
s.fixLoop = function () { s.fixLoop = function () {
var newIndex; var newIndex;
//Fix For Negative Oversliding //Fix For Negative Oversliding

View file

@ -23,7 +23,7 @@ s.lazy = {
srcset = _img.attr('data-srcset'); srcset = _img.attr('data-srcset');
s.loadImage(_img[0], (src || background), srcset, false, function () { s.loadImage(_img[0], (src || background), srcset, false, function () {
if (background) { if (background) {
_img.css('background-image', 'url(' + background + ')'); _img.css('background-image', 'url("' + background + '")');
_img.removeAttr('data-background'); _img.removeAttr('data-background');
} }
else { else {

View file

@ -9,8 +9,14 @@ if (s.params.mousewheelControl) {
try { try {
new window.WheelEvent('wheel'); new window.WheelEvent('wheel');
s.mousewheel.event = 'wheel'; s.mousewheel.event = 'wheel';
} catch (e) {} } catch (e) {
if (window.WheelEvent || (s.container[0] && 'wheel' in s.container[0])) {
s.mousewheel.event = 'wheel';
}
}
if (!s.mousewheel.event && window.WheelEvent) {
}
if (!s.mousewheel.event && document.onmousewheel !== undefined) { if (!s.mousewheel.event && document.onmousewheel !== undefined) {
s.mousewheel.event = 'mousewheel'; s.mousewheel.event = 'mousewheel';
} }
@ -23,10 +29,9 @@ function handleMousewheel(e) {
var we = s.mousewheel.event; var we = s.mousewheel.event;
var delta = 0; var delta = 0;
var rtlFactor = s.rtl ? -1 : 1; var rtlFactor = s.rtl ? -1 : 1;
//Opera & IE
if (e.detail) delta = -e.detail;
//WebKits //WebKits
else if (we === 'mousewheel') { if (we === 'mousewheel') {
if (s.params.mousewheelForceToAxis) { if (s.params.mousewheelForceToAxis) {
if (s.isHorizontal()) { if (s.isHorizontal()) {
if (Math.abs(e.wheelDeltaX) > Math.abs(e.wheelDeltaY)) delta = e.wheelDeltaX * rtlFactor; if (Math.abs(e.wheelDeltaX) > Math.abs(e.wheelDeltaY)) delta = e.wheelDeltaX * rtlFactor;

View file

@ -86,6 +86,9 @@ s.scrollbar = {
if (!s.params.scrollbar) return; if (!s.params.scrollbar) return;
var sb = s.scrollbar; var sb = s.scrollbar;
sb.track = $(s.params.scrollbar); sb.track = $(s.params.scrollbar);
if (s.params.uniqueNavElements && typeof s.params.scrollbar === 'string' && sb.track.length > 1 && s.container.find(s.params.scrollbar).length === 1) {
sb.track = s.container.find(s.params.scrollbar);
}
sb.drag = sb.track.find('.swiper-scrollbar-drag'); sb.drag = sb.track.find('.swiper-scrollbar-drag');
if (sb.drag.length === 0) { if (sb.drag.length === 0) {
sb.drag = $('<div class="swiper-scrollbar-drag"></div>'); sb.drag = $('<div class="swiper-scrollbar-drag"></div>');

View file

@ -16,12 +16,12 @@
}, },
"devDependencies": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.0.33", "version": "1.0.34",
"_release": "1.0.33", "_release": "1.0.34",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.0.33", "tag": "1.0.34",
"commit": "18b04408e1d07fa162db92fa30eec77adfeb0e44" "commit": "1bbacdd65aa7c7af955cdd7f0500a4419064a98b"
}, },
"_source": "git://github.com/MediaBrowser/Emby.ApiClient.Javascript.git", "_source": "git://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
"_target": "~1.0.3", "_target": "~1.0.3",

View file

@ -22,8 +22,6 @@
var webSocket; var webSocket;
var serverInfo = {}; var serverInfo = {};
self.enableAppStorePolicy = false;
/** /**
* Gets the server address. * Gets the server address.
*/ */
@ -1654,10 +1652,6 @@
options = options || {}; options = options || {};
options.PackageType = "UserInstalled"; options.PackageType = "UserInstalled";
if (self.enableAppStorePolicy) {
options.IsAppStoreEnabled = true;
}
var url = self.getUrl("Packages", options); var url = self.getUrl("Packages", options);
return self.getJSON(url); return self.getJSON(url);
@ -2096,10 +2090,6 @@
var options = {}; var options = {};
if (self.enableAppStorePolicy) {
options.IsAppStoreEnabled = true;
}
var url = self.getUrl("Plugins", options); var url = self.getUrl("Plugins", options);
return self.getJSON(url); return self.getJSON(url);

View file

@ -15,12 +15,12 @@
}, },
"devDependencies": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.0.72", "version": "1.0.74",
"_release": "1.0.72", "_release": "1.0.74",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.0.72", "tag": "1.0.74",
"commit": "c06518f026fe592c24aa79312dcecf025e604ef4" "commit": "74afb337ff5f0ee41b75ba5ddb5dea5ec9c20a66"
}, },
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git", "_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "~1.0.0", "_target": "~1.0.0",

View file

@ -51,7 +51,27 @@ define(['browser'], function (browser) {
if (format == 'opus') { if (format == 'opus') {
typeString = 'audio/ogg; codecs="opus"'; typeString = 'audio/ogg; codecs="opus"';
} else if (format == 'webma') {
if (document.createElement('audio').canPlayType(typeString).replace(/no/, '')) {
return true;
}
// Newer mobile chrome supports it but doesn't report it
if (browser.chrome) {
var version = (browser.version || '').toString().split('.')[0];
try {
version = parseInt(version);
if (version >= 48) {
return true;
}
} catch (err) {
}
}
return false;
}
if (format == 'webma') {
typeString = 'audio/webm'; typeString = 'audio/webm';
} else { } else {
typeString = 'audio/' + format; typeString = 'audio/' + format;

View file

@ -1,4 +1,4 @@
define(['paperdialoghelper', 'layoutManager', 'html!./icons.html', 'css!./style.css', 'paper-button', 'paper-input'], function (paperdialoghelper, layoutManager) { define(['paperdialoghelper', 'layoutManager', 'globalize', 'dialogText', 'html!./icons.html', 'css!./style.css', 'paper-button', 'paper-input'], function (paperdialoghelper, layoutManager, globalize, dialogText) {
function show(options, resolve, reject) { function show(options, resolve, reject) {
@ -37,10 +37,12 @@ define(['paperdialoghelper', 'layoutManager', 'html!./icons.html', 'css!./style.
// TODO: An actual form element should probably be added // TODO: An actual form element should probably be added
html += '<br/>'; html += '<br/>';
if (raisedButtons) { if (raisedButtons) {
html += '<paper-button raised class="btnSubmit"><iron-icon icon="dialog:check"></iron-icon><span>' + Globalize.translate('core#ButtonOk') + '</span></paper-button>'; html += '<paper-button raised class="btnSubmit"><iron-icon icon="dialog:check"></iron-icon><span>' + globalize.translate(dialogText.buttonOk) + '</span></paper-button>';
} else { } else {
html += '<paper-button class="btnSubmit">' + Globalize.translate('core#ButtonOk') + '</paper-button>'; html += '<div style="text-align:right;">';
html += '<paper-button class="btnPromptExit">' + Globalize.translate('core#ButtonCancel') + '</paper-button>'; html += '<paper-button class="btnSubmit">' + globalize.translate(dialogText.buttonOk) + '</paper-button>';
html += '<paper-button class="btnPromptExit">' + globalize.translate(dialogText.buttonCancel) + '</paper-button>';
html += '</div>';
} }
html += '</div>'; html += '</div>';

View file

@ -29,14 +29,14 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"ignore": [], "ignore": [],
"homepage": "https://github.com/polymerelements/iron-behaviors", "homepage": "https://github.com/PolymerElements/iron-behaviors",
"_release": "1.0.12", "_release": "1.0.12",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.12", "tag": "v1.0.12",
"commit": "657f526a2382a659cdf4e13be87ecc89261588a3" "commit": "657f526a2382a659cdf4e13be87ecc89261588a3"
}, },
"_source": "git://github.com/polymerelements/iron-behaviors.git", "_source": "git://github.com/PolymerElements/iron-behaviors.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "polymerelements/iron-behaviors" "_originalSource": "PolymerElements/iron-behaviors"
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-dropdown", "name": "iron-dropdown",
"version": "1.1.0", "version": "1.2.0",
"description": "An unstyled element that works similarly to a native browser select", "description": "An unstyled element that works similarly to a native browser select",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"
@ -32,15 +32,15 @@
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0", "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"paper-styles": "polymerelements/paper-styles#^1.0.0", "paper-styles": "polymerelements/paper-styles#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"web-component-tester": "*", "web-component-tester": "^4.0.0",
"iron-image": "polymerelements/iron-image#^1.0.0" "iron-image": "polymerelements/iron-image#^1.0.0"
}, },
"ignore": [], "ignore": [],
"_release": "1.1.0", "_release": "1.2.0",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.1.0", "tag": "v1.2.0",
"commit": "b09b0d57ba917bac9315de4761373d88e85ac52e" "commit": "f864191c6ffbd3aaddea8102102ab40137046327"
}, },
"_source": "git://github.com/polymerelements/iron-dropdown.git", "_source": "git://github.com/polymerelements/iron-dropdown.git",
"_target": "^1.0.0", "_target": "^1.0.0",

View file

@ -1,22 +1,25 @@
language: node_js language: node_js
sudo: false sudo: false
before_script: before_script:
- npm install web-component-tester - npm install -g bower polylint web-component-tester
- npm install bower
- 'export PATH=$PWD/node_modules/.bin:$PATH'
- bower install - bower install
- polylint
env: env:
global: global:
- secure: Nd7sbgkYVekuQRB4K3svNCL3veA6t6aGopNP2FUxlJvQuzRV1vKV67angPvMUAFelEA7/rTzrFPBMfNbsz9C2wInLLLPux4wEk1MQX+2KYZVeXKMHjgl8iQKMXnodaL7XXwBPg0L7053TWtYkIt8wZ/vN0JGPQFKhlQkSrduztkPCJQfkFsMPJ7SudPG3Ld0UPBVxo8TwH/d44p8VhLGiI0oEWw3GnGZZ1T7RJLDAVBwj1BiVHAOaS0SSeOR3ngpZyXbk8OItgzw4o/bbAt2yrHMfwymBy0Xv9v3G0QLFJnMi/gE2lWnN4+IttUPI8gVyr1TuiTgtFxdwteLO3R5iFe+qlQjq0VGssmAHcPwtLhvrT4wEkGMc8ZeyW11z+GdkIw4XHGACWj+9Jz9f19mJd9xU3fkJ+f5mFiB8vEkzjsUI9pswgd3RoHt2WewcVdHnCED2wRdQCw9H34dX7d2ieWKPl/pv+EKZOgEJJ8UNZMyKnj57Y25WRrTpIQBt6p9uVv5MsiZQm7Sd1pYQnJKPQ+BxvvL5fsoT1YkFSjyz9gwijtftXhfL8KLB6i04V3mra3f9d5hc20wAOt+ad+mTOkaM/aGxE/I3Ko13BceMvRSNzuz+N2WE6FEJj1NuOCW/AeSh5/6n9nnlDeu7Nu7VeM9kjk4dyBGNRDWLNcSCEk= - secure: Nd7sbgkYVekuQRB4K3svNCL3veA6t6aGopNP2FUxlJvQuzRV1vKV67angPvMUAFelEA7/rTzrFPBMfNbsz9C2wInLLLPux4wEk1MQX+2KYZVeXKMHjgl8iQKMXnodaL7XXwBPg0L7053TWtYkIt8wZ/vN0JGPQFKhlQkSrduztkPCJQfkFsMPJ7SudPG3Ld0UPBVxo8TwH/d44p8VhLGiI0oEWw3GnGZZ1T7RJLDAVBwj1BiVHAOaS0SSeOR3ngpZyXbk8OItgzw4o/bbAt2yrHMfwymBy0Xv9v3G0QLFJnMi/gE2lWnN4+IttUPI8gVyr1TuiTgtFxdwteLO3R5iFe+qlQjq0VGssmAHcPwtLhvrT4wEkGMc8ZeyW11z+GdkIw4XHGACWj+9Jz9f19mJd9xU3fkJ+f5mFiB8vEkzjsUI9pswgd3RoHt2WewcVdHnCED2wRdQCw9H34dX7d2ieWKPl/pv+EKZOgEJJ8UNZMyKnj57Y25WRrTpIQBt6p9uVv5MsiZQm7Sd1pYQnJKPQ+BxvvL5fsoT1YkFSjyz9gwijtftXhfL8KLB6i04V3mra3f9d5hc20wAOt+ad+mTOkaM/aGxE/I3Ko13BceMvRSNzuz+N2WE6FEJj1NuOCW/AeSh5/6n9nnlDeu7Nu7VeM9kjk4dyBGNRDWLNcSCEk=
- secure: aFsYKL6Sw8/r57wzj3pnzEwBE1mnTajJasHAbXgQMd336S2Sq/f39DCNTXgKBA4AKZGvWKe8w9nzaocQoMa4l9bLWEBJMCMPQFawOhTkuEjsLjpU3g74b46/EhjBP5zixR32xoyF5o9FTzC6UyrDjt2XpKwIQJYxaEfoyIW1vTPdoasWdaG5rXvWFTsmXtaMDpCKFH9aQ1DHn9Sbi9NZlR4izdULsbv9GZwg53xvuH4xYEkGtB29KKy04uK1nJ+9SmRWTAnu4Q/ivYWlbwBArjiYTTi0wclvDNvT1iaFNAaeK2pJea8CnoyJJ0pg9NcuzZtStGUvP00kGUpJQ4lqkr+gBCHDPYtoZ17XCz59cg6LrhG1q//vPi7Yz0xW51GHuwmcVs+PsjmWaRuO/1UFreDCQYf+GU4I1pQZf2q1R4m8noe4i5CcFXLKTrC4udBzPmzVB4As2LsxRc3HCIXmhaMxI8MJwdkQBA22u4vCwU2xpqBawJocj0Gvbeme6wG99PW7+XSkijQDk2cTJ5/CJtY22nAECvn4tve3OVvybSTjQ1yipLxJm/dtjgEXFWtknFZr++tId88wPd3EBtrwEhliD3zD/TyLPO2RPZGuI0i6oD3O89P5d8qp66T/eByDr1IEm0+FIQjgiCEMbhmaIuUKGG2GCfwPglI3uR0kbg0= - secure: aFsYKL6Sw8/r57wzj3pnzEwBE1mnTajJasHAbXgQMd336S2Sq/f39DCNTXgKBA4AKZGvWKe8w9nzaocQoMa4l9bLWEBJMCMPQFawOhTkuEjsLjpU3g74b46/EhjBP5zixR32xoyF5o9FTzC6UyrDjt2XpKwIQJYxaEfoyIW1vTPdoasWdaG5rXvWFTsmXtaMDpCKFH9aQ1DHn9Sbi9NZlR4izdULsbv9GZwg53xvuH4xYEkGtB29KKy04uK1nJ+9SmRWTAnu4Q/ivYWlbwBArjiYTTi0wclvDNvT1iaFNAaeK2pJea8CnoyJJ0pg9NcuzZtStGUvP00kGUpJQ4lqkr+gBCHDPYtoZ17XCz59cg6LrhG1q//vPi7Yz0xW51GHuwmcVs+PsjmWaRuO/1UFreDCQYf+GU4I1pQZf2q1R4m8noe4i5CcFXLKTrC4udBzPmzVB4As2LsxRc3HCIXmhaMxI8MJwdkQBA22u4vCwU2xpqBawJocj0Gvbeme6wG99PW7+XSkijQDk2cTJ5/CJtY22nAECvn4tve3OVvybSTjQ1yipLxJm/dtjgEXFWtknFZr++tId88wPd3EBtrwEhliD3zD/TyLPO2RPZGuI0i6oD3O89P5d8qp66T/eByDr1IEm0+FIQjgiCEMbhmaIuUKGG2GCfwPglI3uR0kbg0=
node_js: 4 - CXX=g++-4.8
node_js: stable
addons: addons:
firefox: latest firefox: latest
apt: apt:
sources: sources:
- google-chrome - google-chrome
- ubuntu-toolchain-r-test
packages: packages:
- google-chrome-stable - google-chrome-stable
- g++-4.8
sauce_connect: true
script: script:
- xvfb-run wct - xvfb-run wct
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi" - "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"

View file

@ -5,6 +5,11 @@ https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
If you edit that file, it will get updated everywhere else. If you edit that file, it will get updated everywhere else.
If you edit this file, your changes will get overridden :) If you edit this file, your changes will get overridden :)
You can however override the jsbin link with one that's customized to this
specific element:
jsbin=https://jsbin.com/cagaye/edit?html,output
--> -->
# Polymer Elements # Polymer Elements
## Guide for Contributors ## Guide for Contributors
@ -41,7 +46,7 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
3. Click the `paper-foo` element. 3. Click the `paper-foo` element.
``` ```
2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [http://jsbin.com/cagaye](http://jsbin.com/cagaye/edit?html,output). 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [https://jsbin.com/cagaye/edit?html,output](https://jsbin.com/cagaye/edit?html,output).
3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers. 3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers.
@ -51,14 +56,14 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
When submitting pull requests, please provide: When submitting pull requests, please provide:
1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues using the following syntax: 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues in the pull request description using the following syntax:
```markdown ```markdown
(For a single issue) (For a single issue)
Fixes #20 Fixes #20
(For multiple issues) (For multiple issues)
Fixes #32, #40 Fixes #32, fixes #40
``` ```
2. **A succinct description of the design** used to fix any related issues. For example: 2. **A succinct description of the design** used to fix any related issues. For example:

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-dropdown", "name": "iron-dropdown",
"version": "1.1.0", "version": "1.2.0",
"description": "An unstyled element that works similarly to a native browser select", "description": "An unstyled element that works similarly to a native browser select",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"
@ -32,7 +32,7 @@
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0", "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"paper-styles": "polymerelements/paper-styles#^1.0.0", "paper-styles": "polymerelements/paper-styles#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"web-component-tester": "*", "web-component-tester": "^4.0.0",
"iron-image": "polymerelements/iron-image#^1.0.0" "iron-image": "polymerelements/iron-image#^1.0.0"
}, },
"ignore": [] "ignore": []

View file

@ -79,6 +79,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
* @param {HTMLElement} element The element that should lock scroll. * @param {HTMLElement} element The element that should lock scroll.
*/ */
pushScrollLock: function(element) { pushScrollLock: function(element) {
// Prevent pushing the same element twice
if (this._lockingElements.indexOf(element) >= 0) {
return;
}
if (this._lockingElements.length === 0) { if (this._lockingElements.length === 0) {
this._lockScrollInteractions(); this._lockScrollInteractions();
} }
@ -172,7 +177,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
_scrollInteractionHandler: function(event) { _scrollInteractionHandler: function(event) {
if (Polymer if (Polymer
.IronDropdownScrollManager .IronDropdownScrollManager
.elementIsScrollLocked(event.target)) { .elementIsScrollLocked(Polymer.dom(event).rootTarget)) {
if (event.type === 'keydown' && if (event.type === 'keydown' &&
!Polymer.IronDropdownScrollManager._isScrollingKeypress(event)) { !Polymer.IronDropdownScrollManager._isScrollingKeypress(event)) {
return; return;
@ -199,13 +204,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
document.body.style.overflowY = 'hidden'; document.body.style.overflowY = 'hidden';
// Modern `wheel` event for mouse wheel scrolling: // Modern `wheel` event for mouse wheel scrolling:
window.addEventListener('wheel', this._scrollInteractionHandler, true); document.addEventListener('wheel', this._scrollInteractionHandler, true);
// Older, non-standard `mousewheel` event for some FF: // Older, non-standard `mousewheel` event for some FF:
window.addEventListener('mousewheel', this._scrollInteractionHandler, true); document.addEventListener('mousewheel', this._scrollInteractionHandler, true);
// IE: // IE:
window.addEventListener('DOMMouseScroll', this._scrollInteractionHandler, true); document.addEventListener('DOMMouseScroll', this._scrollInteractionHandler, true);
// Mobile devices can scroll on touch move: // Mobile devices can scroll on touch move:
window.addEventListener('touchmove', this._scrollInteractionHandler, true); document.addEventListener('touchmove', this._scrollInteractionHandler, true);
// Capture keydown to prevent scrolling keys (pageup, pagedown etc.) // Capture keydown to prevent scrolling keys (pageup, pagedown etc.)
document.addEventListener('keydown', this._scrollInteractionHandler, true); document.addEventListener('keydown', this._scrollInteractionHandler, true);
}, },
@ -215,10 +220,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
document.body.style.overflowX = this._originalBodyStyles.overflowX; document.body.style.overflowX = this._originalBodyStyles.overflowX;
document.body.style.overflowY = this._originalBodyStyles.overflowY; document.body.style.overflowY = this._originalBodyStyles.overflowY;
window.removeEventListener('wheel', this._scrollInteractionHandler, true); document.removeEventListener('wheel', this._scrollInteractionHandler, true);
window.removeEventListener('mousewheel', this._scrollInteractionHandler, true); document.removeEventListener('mousewheel', this._scrollInteractionHandler, true);
window.removeEventListener('DOMMouseScroll', this._scrollInteractionHandler, true); document.removeEventListener('DOMMouseScroll', this._scrollInteractionHandler, true);
window.removeEventListener('touchmove', this._scrollInteractionHandler, true); document.removeEventListener('touchmove', this._scrollInteractionHandler, true);
document.removeEventListener('keydown', this._scrollInteractionHandler, true); document.removeEventListener('keydown', this._scrollInteractionHandler, true);
} }
}; };

View file

@ -224,6 +224,7 @@ method is called on the element.
/** /**
* The element that should be focused when the dropdown opens. * The element that should be focused when the dropdown opens.
* @deprecated
*/ */
get _focusTarget() { get _focusTarget() {
return this.focusTarget || this.containedElement; return this.focusTarget || this.containedElement;
@ -323,10 +324,6 @@ method is called on the element.
this._prepareDropdown(); this._prepareDropdown();
Polymer.IronOverlayBehaviorImpl._openedChanged.apply(this, arguments); Polymer.IronOverlayBehaviorImpl._openedChanged.apply(this, arguments);
} }
if (this.opened) {
this._focusContent();
}
}, },
/** /**
@ -381,7 +378,7 @@ method is called on the element.
var scrollTop; var scrollTop;
var scrollLeft; var scrollLeft;
if (containedElement) { if (this.opened && containedElement) {
scrollTop = containedElement.scrollTop; scrollTop = containedElement.scrollTop;
scrollLeft = containedElement.scrollLeft; scrollLeft = containedElement.scrollLeft;
} }
@ -392,7 +389,7 @@ method is called on the element.
Polymer.IronOverlayBehaviorImpl._onIronResize.apply(this, arguments); Polymer.IronOverlayBehaviorImpl._onIronResize.apply(this, arguments);
if (containedElement) { if (this.opened && containedElement) {
containedElement.scrollTop = scrollTop; containedElement.scrollTop = scrollTop;
containedElement.scrollLeft = scrollLeft; containedElement.scrollLeft = scrollLeft;
} }
@ -477,16 +474,15 @@ method is called on the element.
}, },
/** /**
* Focuses the configured focus target. * Apply focus to focusTarget or containedElement
*/ */
_focusContent: function() { _applyFocus: function () {
// NOTE(cdata): This is async so that it can attempt the focus after var focusTarget = this.focusTarget || this.containedElement;
// `display: none` is removed from the element. if (focusTarget && this.opened && !this.noAutoFocus) {
this.async(function() { focusTarget.focus();
if (this._focusTarget) { } else {
this._focusTarget.focus(); Polymer.IronOverlayBehaviorImpl._applyFocus.apply(this, arguments);
} }
});
} }
}); });
})(); })();

View file

@ -21,19 +21,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../iron-dropdown-scroll-manager.html"> <link rel="import" href="../iron-dropdown-scroll-manager.html">
<link rel="import" href="../../test-fixture/test-fixture.html"> <link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="x-scrollable-element.html">
</head> </head>
<body> <body>
<test-fixture id="DOMSubtree"> <test-fixture id="DOMSubtree">
<template> <template>
<div id="Parent"> <x-scrollable-element id="Parent"></x-scrollable-element>
<div id="ChildOne">
<div id="GrandchildOne"></div>
</div>
<div id="ChildTwo">
<div id="GrandchildTwo"></div>
</div>
</div>
</template> </template>
</test-fixture> </test-fixture>
<script> <script>
@ -47,14 +41,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
setup(function() { setup(function() {
parent = fixture('DOMSubtree'); parent = fixture('DOMSubtree');
childOne = parent.querySelector('#ChildOne'); childOne = parent.$$('#ChildOne');
childTwo = parent.querySelector('#ChildTwo'); childTwo = parent.$$('#ChildTwo');
grandChildOne = parent.querySelector('#GrandchildOne'); grandChildOne = parent.$$('#GrandchildOne');
grandChildTwo = parent.querySelector('#GrandchildTwo'); grandChildTwo = parent.$$('#GrandchildTwo');
ancestor = document.body; ancestor = document.body;
}); });
suite('contraining scroll in the DOM', function() { suite('constraining scroll in the DOM', function() {
setup(function() { setup(function() {
Polymer.IronDropdownScrollManager.pushScrollLock(childOne); Polymer.IronDropdownScrollManager.pushScrollLock(childOne);
}); });
@ -99,6 +93,58 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
expect(Polymer.IronDropdownScrollManager.elementIsScrollLocked(parent)) expect(Polymer.IronDropdownScrollManager.elementIsScrollLocked(parent))
.to.be.equal(false); .to.be.equal(false);
}); });
test('does not check locked elements when there are no locking elements', function() {
sinon.spy(Polymer.IronDropdownScrollManager, 'elementIsScrollLocked');
childOne.dispatchEvent(new CustomEvent('wheel', {
bubbles: true,
cancelable: true
}));
expect(Polymer.IronDropdownScrollManager
.elementIsScrollLocked.callCount).to.be.eql(1);
Polymer.IronDropdownScrollManager.removeScrollLock(childOne);
childOne.dispatchEvent(new CustomEvent('wheel', {
bubbles: true,
cancelable: true
}));
expect(Polymer.IronDropdownScrollManager
.elementIsScrollLocked.callCount).to.be.eql(1);
});
suite('various scroll events', function() {
var scrollEvents;
var events;
setup(function() {
scrollEvents = [
'wheel',
'mousewheel',
'DOMMouseScroll',
'touchmove'
];
events = scrollEvents.map(function(scrollEvent) {
return new CustomEvent(scrollEvent, {
bubbles: true,
cancelable: true
});
});
});
test('prevents wheel events from locked elements', function() {
events.forEach(function(event) {
childTwo.dispatchEvent(event);
expect(event.defaultPrevented).to.be.eql(true);
});
});
test('allows wheel events from unlocked elements', function() {
events.forEach(function(event) {
childOne.dispatchEvent(event);
expect(event.defaultPrevented).to.be.eql(false);
});
});
});
}); });
}); });
</script> </script>

View file

@ -118,6 +118,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
contentRect.height > 0; contentRect.height > 0;
} }
function runAfterOpen(overlay, cb) {
overlay.addEventListener('iron-overlay-opened', function () {
Polymer.Base.async(cb, 1);
});
overlay.open();
}
suite('<iron-dropdown>', function() { suite('<iron-dropdown>', function() {
var dropdown; var dropdown;
var content; var content;
@ -133,31 +140,20 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}); });
test('shows dropdown content when opened', function(done) { test('shows dropdown content when opened', function(done) {
dropdown.open(); runAfterOpen(dropdown, function () {
Polymer.Base.async(function() {
expect(elementIsVisible(content)).to.be.equal(true); expect(elementIsVisible(content)).to.be.equal(true);
done(); done();
}); });
}); });
test('hides dropdown content when outside is clicked', function(done) { test('hides dropdown content when outside is clicked', function(done) {
dropdown.open(); runAfterOpen(dropdown, function () {
Polymer.Base.async(function() {
expect(elementIsVisible(content)).to.be.equal(true); expect(elementIsVisible(content)).to.be.equal(true);
// The document capture-click listeners are set async.
// Note(noms): I think this bit in iron-overlay-behavior is pretty
// brittle, so if the tests start failing in the future, make sure
// _toggleListeners is getting called at the right time.
Polymer.Base.async(function() {
MockInteractions.tap(dropdown.parentNode); MockInteractions.tap(dropdown.parentNode);
Polymer.Base.async(function() { Polymer.Base.async(function() {
expect(elementIsVisible(content)).to.be.equal(false); expect(elementIsVisible(content)).to.be.equal(false);
done(); done();
}, 100); }, 10);
}, 1);
}); });
}); });
@ -167,9 +163,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
content = Polymer.dom(dropdown).querySelector('.dropdown-content'); content = Polymer.dom(dropdown).querySelector('.dropdown-content');
}); });
test('focuses the content when opened', function(done) { test('focuses the content when opened', function(done) {
dropdown.open(); runAfterOpen(dropdown, function () {
Polymer.Base.async(function() {
expect(document.activeElement).to.be.equal(content); expect(document.activeElement).to.be.equal(content);
done(); done();
}); });
@ -179,9 +173,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
var focusableChild = Polymer.dom(content).querySelector('div[tabindex]'); var focusableChild = Polymer.dom(content).querySelector('div[tabindex]');
dropdown.focusTarget = focusableChild; dropdown.focusTarget = focusableChild;
dropdown.open(); runAfterOpen(dropdown, function () {
Polymer.Base.async(function() {
expect(document.activeElement).to.not.be.equal(content); expect(document.activeElement).to.not.be.equal(content);
expect(document.activeElement).to.be.equal(focusableChild); expect(document.activeElement).to.be.equal(focusableChild);
done(); done();
@ -193,14 +185,40 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
suite('locking scroll', function() { suite('locking scroll', function() {
var dropdown; var dropdown;
setup(function() {
dropdown = fixture('TrivialDropdown');
});
test('should lock, only once', function(done) {
var openCount = 0;
runAfterOpen(dropdown, function() {
expect(Polymer.IronDropdownScrollManager._lockingElements.length)
.to.be.equal(1);
expect(Polymer.IronDropdownScrollManager.elementIsScrollLocked(document.body))
.to.be.equal(true);
if(openCount === 0) {
// This triggers a second `pushScrollLock` with the same element, however
// that should not add the element to the `_lockingElements` stack twice
dropdown.close();
dropdown.open();
} else {
done();
}
openCount++;
});
});
});
suite('non locking scroll', function() {
var dropdown;
setup(function() { setup(function() {
dropdown = fixture('NonLockingDropdown'); dropdown = fixture('NonLockingDropdown');
}); });
test('can be disabled with `allowOutsideScroll`', function(done) { test('can be disabled with `allowOutsideScroll`', function(done) {
dropdown.open(); runAfterOpen(dropdown, function () {
Polymer.Base.async(function() {
expect(Polymer.IronDropdownScrollManager.elementIsScrollLocked(document.body)) expect(Polymer.IronDropdownScrollManager.elementIsScrollLocked(document.body))
.to.be.equal(false); .to.be.equal(false);
done(); done();
@ -219,9 +237,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
var parentRect; var parentRect;
var dropdownRect; var dropdownRect;
dropdown.opened = true; runAfterOpen(dropdown, function () {
Polymer.Base.async(function() {
dropdownRect = dropdown.getBoundingClientRect(); dropdownRect = dropdown.getBoundingClientRect();
parentRect = parent.getBoundingClientRect(); parentRect = parent.getBoundingClientRect();
@ -230,7 +246,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
expect(dropdownRect.top).to.be.closeTo(parentRect.top, 0.1); expect(dropdownRect.top).to.be.closeTo(parentRect.top, 0.1);
expect(dropdownRect.right).to.be.closeTo(parentRect.right, 0.1); expect(dropdownRect.right).to.be.closeTo(parentRect.right, 0.1);
done(); done();
}, 1); });
}); });
test('can be re-aligned to the bottom', function(done) { test('can be re-aligned to the bottom', function(done) {
@ -238,9 +254,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
var dropdownRect; var dropdownRect;
dropdown.verticalAlign = 'bottom'; dropdown.verticalAlign = 'bottom';
dropdown.opened = true; runAfterOpen(dropdown, function () {
Polymer.Base.async(function() {
parentRect = parent.getBoundingClientRect(); parentRect = parent.getBoundingClientRect();
dropdownRect = dropdown.getBoundingClientRect(); dropdownRect = dropdown.getBoundingClientRect();
@ -249,7 +263,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
expect(dropdownRect.bottom).to.be.closeTo(parentRect.bottom, 0.1); expect(dropdownRect.bottom).to.be.closeTo(parentRect.bottom, 0.1);
expect(dropdownRect.right).to.be.closeTo(parentRect.right, 0.1); expect(dropdownRect.right).to.be.closeTo(parentRect.right, 0.1);
done(); done();
}, 1); });
}); });
}); });
@ -263,9 +277,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}); });
test('can be offset towards the bottom right', function(done) { test('can be offset towards the bottom right', function(done) {
dropdown.opened = true; runAfterOpen(dropdown, function () {
Polymer.Base.async(function() {
dropdownRect = dropdown.getBoundingClientRect(); dropdownRect = dropdown.getBoundingClientRect();
dropdown.verticalOffset = 10; dropdown.verticalOffset = 10;
@ -277,13 +289,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
// horizontalAlign is left, so a positive offset moves to the right. // horizontalAlign is left, so a positive offset moves to the right.
expect(dropdownRect.left + 10).to.be.closeTo(offsetDropdownRect.left, 0.1); expect(dropdownRect.left + 10).to.be.closeTo(offsetDropdownRect.left, 0.1);
done(); done();
}, 1); });
}); });
test('can be offset towards the top left', function(done) { test('can be offset towards the top left', function(done) {
dropdown.opened = true; runAfterOpen(dropdown, function () {
Polymer.Base.async(function() {
dropdownRect = dropdown.getBoundingClientRect(); dropdownRect = dropdown.getBoundingClientRect();
dropdown.verticalOffset = -10; dropdown.verticalOffset = -10;
@ -295,7 +305,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
// horizontalAlign is left, so a negative offset moves to the left. // horizontalAlign is left, so a negative offset moves to the left.
expect(dropdownRect.left - 10).to.be.closeTo(offsetDropdownRect.left, 0.1); expect(dropdownRect.left - 10).to.be.closeTo(offsetDropdownRect.left, 0.1);
done(); done();
}, 1); });
}); });
}); });
@ -309,9 +319,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}); });
test('can be offset towards the top left', function(done) { test('can be offset towards the top left', function(done) {
dropdown.opened = true; runAfterOpen(dropdown, function () {
Polymer.Base.async(function() {
dropdownRect = dropdown.getBoundingClientRect(); dropdownRect = dropdown.getBoundingClientRect();
dropdown.verticalOffset = 10; dropdown.verticalOffset = 10;
@ -323,13 +331,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
// horizontalAlign is right, so a positive offset moves to the left. // horizontalAlign is right, so a positive offset moves to the left.
expect(dropdownRect.right - 10).to.be.closeTo(offsetDropdownRect.right, 0.1); expect(dropdownRect.right - 10).to.be.closeTo(offsetDropdownRect.right, 0.1);
done(); done();
}, 1); });
}); });
test('can be offset towards the bottom right', function(done) { test('can be offset towards the bottom right', function(done) {
dropdown.opened = true; runAfterOpen(dropdown, function () {
Polymer.Base.async(function() {
dropdownRect = dropdown.getBoundingClientRect(); dropdownRect = dropdown.getBoundingClientRect();
dropdown.verticalOffset = -10; dropdown.verticalOffset = -10;
@ -341,7 +347,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
// horizontalAlign is right, so a positive offset moves to the right. // horizontalAlign is right, so a positive offset moves to the right.
expect(dropdownRect.right + 10).to.be.closeTo(offsetDropdownRect.right, 0.1); expect(dropdownRect.right + 10).to.be.closeTo(offsetDropdownRect.right, 0.1);
done(); done();
}, 1); });
}); });
}); });
@ -352,9 +358,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('with horizontalAlign=left', function(done) { test('with horizontalAlign=left', function(done) {
var parent = fixture('RTLDropdownLeft'); var parent = fixture('RTLDropdownLeft');
dropdown = parent.querySelector('iron-dropdown'); dropdown = parent.querySelector('iron-dropdown');
dropdown.open(); runAfterOpen(dropdown, function () {
Polymer.Base.async(function() {
// In RTL, if `horizontalAlign` is "left", that's the same as // In RTL, if `horizontalAlign` is "left", that's the same as
// being right-aligned in LTR. So the dropdown should be in the top // being right-aligned in LTR. So the dropdown should be in the top
// right corner. // right corner.
@ -368,9 +372,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('with horizontalAlign=right', function(done) { test('with horizontalAlign=right', function(done) {
var parent = fixture('RTLDropdownRight'); var parent = fixture('RTLDropdownRight');
dropdown = parent.querySelector('iron-dropdown'); dropdown = parent.querySelector('iron-dropdown');
dropdown.open(); runAfterOpen(dropdown, function () {
Polymer.Base.async(function() {
// In RTL, if `horizontalAlign` is "right", that's the same as // In RTL, if `horizontalAlign` is "right", that's the same as
// being left-aligned in LTR. So the dropdown should be in the top // being left-aligned in LTR. So the dropdown should be in the top
// left corner. // left corner.

View file

@ -0,0 +1,27 @@
<!--
@license
Copyright (c) 2015 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
-->
<link rel="import" href="../../polymer/polymer.html">
<dom-module id="x-scrollable-element">
<template>
<div id="ChildOne">
<div id="GrandchildOne"></div>
</div>
<div id="ChildTwo">
<div id="GrandchildTwo"></div>
</div>
</template>
<script>
Polymer({
is: 'x-scrollable-element'
});
</script>
</dom-module>

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-overlay-behavior", "name": "iron-overlay-behavior",
"version": "1.2.0", "version": "1.3.0",
"license": "http://polymer.github.io/LICENSE.txt", "license": "http://polymer.github.io/LICENSE.txt",
"description": "Provides a behavior for making an element an overlay", "description": "Provides a behavior for making an element an overlay",
"private": true, "private": true,
@ -19,26 +19,25 @@
"url": "git://github.com/PolymerElements/iron-overlay-behavior.git" "url": "git://github.com/PolymerElements/iron-overlay-behavior.git"
}, },
"dependencies": { "dependencies": {
"polymer": "Polymer/polymer#^1.0.0",
"iron-fit-behavior": "PolymerElements/iron-fit-behavior#^1.0.0", "iron-fit-behavior": "PolymerElements/iron-fit-behavior#^1.0.0",
"iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0" "iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0",
"polymer": "Polymer/polymer#^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0", "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0", "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0", "paper-styles": "PolymerElements/paper-styles#^1.0.2",
"web-component-tester": "^4.0.0", "web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"ignore": [], "ignore": [],
"homepage": "https://github.com/polymerelements/iron-overlay-behavior", "homepage": "https://github.com/polymerelements/iron-overlay-behavior",
"_release": "1.2.0", "_release": "1.3.0",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.2.0", "tag": "v1.3.0",
"commit": "1d8e1d29c601add9c135e5103c4d1d0d652dd957" "commit": "b488ce94ec1c17c3a5491af1a2fba2f7382684da"
}, },
"_source": "git://github.com/polymerelements/iron-overlay-behavior.git", "_source": "git://github.com/polymerelements/iron-overlay-behavior.git",
"_target": "^1.0.0", "_target": "^1.0.0",

View file

@ -5,6 +5,11 @@ https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
If you edit that file, it will get updated everywhere else. If you edit that file, it will get updated everywhere else.
If you edit this file, your changes will get overridden :) If you edit this file, your changes will get overridden :)
You can however override the jsbin link with one that's customized to this
specific element:
jsbin=https://jsbin.com/cagaye/edit?html,output
--> -->
# Polymer Elements # Polymer Elements
## Guide for Contributors ## Guide for Contributors
@ -41,7 +46,7 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
3. Click the `paper-foo` element. 3. Click the `paper-foo` element.
``` ```
2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [http://jsbin.com/cagaye](http://jsbin.com/cagaye/edit?html,output). 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [https://jsbin.com/cagaye/edit?html,output](https://jsbin.com/cagaye/edit?html,output).
3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers. 3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers.
@ -51,14 +56,14 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
When submitting pull requests, please provide: When submitting pull requests, please provide:
1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues using the following syntax: 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues in the pull request description using the following syntax:
```markdown ```markdown
(For a single issue) (For a single issue)
Fixes #20 Fixes #20
(For multiple issues) (For multiple issues)
Fixes #32, #40 Fixes #32, fixes #40
``` ```
2. **A succinct description of the design** used to fix any related issues. For example: 2. **A succinct description of the design** used to fix any related issues. For example:

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-overlay-behavior", "name": "iron-overlay-behavior",
"version": "1.2.0", "version": "1.3.0",
"license": "http://polymer.github.io/LICENSE.txt", "license": "http://polymer.github.io/LICENSE.txt",
"description": "Provides a behavior for making an element an overlay", "description": "Provides a behavior for making an element an overlay",
"private": true, "private": true,
@ -19,16 +19,15 @@
"url": "git://github.com/PolymerElements/iron-overlay-behavior.git" "url": "git://github.com/PolymerElements/iron-overlay-behavior.git"
}, },
"dependencies": { "dependencies": {
"polymer": "Polymer/polymer#^1.0.0",
"iron-fit-behavior": "PolymerElements/iron-fit-behavior#^1.0.0", "iron-fit-behavior": "PolymerElements/iron-fit-behavior#^1.0.0",
"iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0" "iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0",
"polymer": "Polymer/polymer#^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0", "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0", "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0", "paper-styles": "PolymerElements/paper-styles#^1.0.2",
"web-component-tester": "^4.0.0", "web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },

View file

@ -120,7 +120,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<button data-dialog="backdrop">backdrop</button> <button data-dialog="backdrop">backdrop</button>
<simple-overlay id="backdrop" with-backdrop> <simple-overlay id="backdrop" with-backdrop>
Hello world! <p>Hello world!</p>
<button>button</button>
<button>button</button>
<button>button</button>
</simple-overlay> </simple-overlay>
<button data-dialog="autofocus">autofocus</button> <button data-dialog="autofocus">autofocus</button>

View file

@ -118,10 +118,14 @@ Custom property | Description | Default
this.style.zIndex = this._manager.backdropZ(); this.style.zIndex = this._manager.backdropZ();
// close only if no element with backdrop is left // close only if no element with backdrop is left
if (this._manager.getBackdrops().length === 0) { if (this._manager.getBackdrops().length === 0) {
// Read style before setting opened.
var cs = getComputedStyle(this);
var noAnimation = (cs.transitionDuration === '0s' || cs.opacity == 0);
this._setOpened(false); this._setOpened(false);
// complete() will be called after the transition is done. // In case of no animations, complete
// If animations are disabled via custom-styles, user is expected to call if (noAnimation) {
// complete() after close() this.complete();
}
} }
}, },

View file

@ -135,6 +135,18 @@ context. You should place this element as a child of `<body>` whenever possible.
value: function() { value: function() {
return this._onCaptureKeydown.bind(this); return this._onCaptureKeydown.bind(this);
} }
},
_boundOnCaptureFocus: {
type: Function,
value: function() {
return this._onCaptureFocus.bind(this);
}
},
/** @type {?Node} */
_focusedChild: {
type: Object
} }
}, },
@ -152,10 +164,13 @@ context. You should place this element as a child of `<body>` whenever possible.
}, },
get _focusNode() { get _focusNode() {
return Polymer.dom(this).querySelector('[autofocus]') || this; return this._focusedChild || Polymer.dom(this).querySelector('[autofocus]') || this;
}, },
ready: function() { ready: function() {
// with-backdrop need tabindex to be set in order to trap the focus.
// If it is not set, IronOverlayBehavior will set it, and remove it if with-backdrop = false.
this.__shouldRemoveTabIndex = false;
this._ensureSetup(); this._ensureSetup();
}, },
@ -265,6 +280,14 @@ context. You should place this element as a child of `<body>` whenever possible.
}, },
_withBackdropChanged: function() { _withBackdropChanged: function() {
// If tabindex is already set, no need to override it.
if (this.withBackdrop && !this.hasAttribute('tabindex')) {
this.setAttribute('tabindex', '-1');
this.__shouldRemoveTabIndex = true;
} else if (this.__shouldRemoveTabIndex) {
this.removeAttribute('tabindex');
this.__shouldRemoveTabIndex = false;
}
if (this.opened) { if (this.opened) {
this._manager.trackBackdrop(this); this._manager.trackBackdrop(this);
if (this.withBackdrop) { if (this.withBackdrop) {
@ -298,6 +321,7 @@ context. You should place this element as a child of `<body>` whenever possible.
_toggleListeners: function () { _toggleListeners: function () {
this._toggleListener(this.opened, document, 'tap', this._boundOnCaptureClick, true); this._toggleListener(this.opened, document, 'tap', this._boundOnCaptureClick, true);
this._toggleListener(this.opened, document, 'keydown', this._boundOnCaptureKeydown, true); this._toggleListener(this.opened, document, 'keydown', this._boundOnCaptureKeydown, true);
this._toggleListener(this.opened, document, 'focus', this._boundOnCaptureFocus, true);
}, },
// tasks which must occur before opening; e.g. making the element visible // tasks which must occur before opening; e.g. making the element visible
@ -343,6 +367,7 @@ context. You should place this element as a child of `<body>` whenever possible.
this.style.display = 'none'; this.style.display = 'none';
this._manager.removeOverlay(this); this._manager.removeOverlay(this);
this._focusedChild = null;
this._applyFocus(); this._applyFocus();
this.notifyResize(); this.notifyResize();
@ -376,10 +401,13 @@ context. You should place this element as a child of `<body>` whenever possible.
_onCaptureClick: function(event) { _onCaptureClick: function(event) {
if (this._manager.currentOverlay() === this && if (this._manager.currentOverlay() === this &&
!this.noCancelOnOutsideClick &&
Polymer.dom(event).path.indexOf(this) === -1) { Polymer.dom(event).path.indexOf(this) === -1) {
if (this.noCancelOnOutsideClick) {
this._applyFocus();
} else {
this.cancel(); this.cancel();
} }
}
}, },
_onCaptureKeydown: function(event) { _onCaptureKeydown: function(event) {
@ -391,6 +419,19 @@ context. You should place this element as a child of `<body>` whenever possible.
} }
}, },
_onCaptureFocus: function (event) {
if (this._manager.currentOverlay() === this &&
this.withBackdrop) {
var path = Polymer.dom(event).path;
if (path.indexOf(this) === -1) {
event.stopPropagation();
this._applyFocus();
} else {
this._focusedChild = path[0];
}
}
},
_onIronResize: function() { _onIronResize: function() {
if (this.opened) { if (this.opened) {
this.refit(); this.refit();

View file

@ -323,6 +323,19 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}); });
}); });
test('no-cancel-on-outside-click property; focus stays on overlay when click outside', function(done) {
overlay = fixture('autofocus');
overlay.noCancelOnOutsideClick = true;
runAfterOpen(overlay, function() {
MockInteractions.tap(document.body);
setTimeout(function() {
assert.equal(Polymer.dom(overlay).querySelector('[autofocus]'), document.activeElement, '<button autofocus> is focused');
done();
}, 10);
});
});
test('no-cancel-on-esc-key property', function(done) { test('no-cancel-on-esc-key property', function(done) {
overlay.noCancelOnEscKey = true; overlay.noCancelOnEscKey = true;
runAfterOpen(overlay, function() { runAfterOpen(overlay, function() {
@ -465,6 +478,42 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
overlays[0].opened = false; overlays[0].opened = false;
assert.equal(overlays[0]._manager.getBackdrops().length, 0, 'overlay removed from manager backdrops'); assert.equal(overlays[0]._manager.getBackdrops().length, 0, 'overlay removed from manager backdrops');
}); });
test('with-backdrop sets tabindex=-1 and removes it', function() {
var overlay = fixture('basic');
overlay.withBackdrop = true;
assert.equal(overlay.getAttribute('tabindex'), '-1', 'tabindex is -1');
overlay.withBackdrop = false;
assert.isFalse(overlay.hasAttribute('tabindex'), 'tabindex removed');
});
test('with-backdrop does not override tabindex if already set', function() {
var overlay = fixture('basic');
overlay.setAttribute('tabindex', '1');
overlay.withBackdrop = true;
assert.equal(overlay.getAttribute('tabindex'), '1', 'tabindex is 1');
overlay.withBackdrop = false;
assert.equal(overlay.getAttribute('tabindex'), '1', 'tabindex is still 1');
});
test('with-backdrop traps the focus within the overlay', function(done) {
// Add button to try to "steal" focus.
var button = document.createElement('button');
var focusSpy = sinon.stub();
button.addEventListener('focus', focusSpy, true);
document.body.appendChild(button);
var overlay = fixture('autofocus');
overlay.withBackdrop = true;
runAfterOpen(overlay, function() {
// Try to steal the focus
MockInteractions.focus(button);
assert.isFalse(focusSpy.called, 'button in body did not get the focus');
assert.equal(Polymer.dom(overlay).querySelector('[autofocus]'), document.activeElement, '<button autofocus> is focused');
button.parentNode.removeChild(button);
done();
});
});
}); });
suite('multiple overlays with backdrop', function() { suite('multiple overlays with backdrop', function() {
@ -492,17 +541,31 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}); });
test('updating with-backdrop to false closes backdrop', function(done) { test('updating with-backdrop to false closes backdrop', function(done) {
// no waiting for animations
overlays[0].backdropElement.style.transitionDuration = '0s';
runAfterOpen(overlays[0], function() { runAfterOpen(overlays[0], function() {
overlays[0].withBackdrop = false; overlays[0].withBackdrop = false;
// Don't wait for animations.
overlays[0].backdropElement.complete();
assert.isFalse(overlays[0].backdropElement.opened, 'backdrop is closed'); assert.isFalse(overlays[0].backdropElement.opened, 'backdrop is closed');
assert.isNotObject(overlays[0].backdropElement.parentNode, 'backdrop is removed from document'); assert.isNotObject(overlays[0].backdropElement.parentNode, 'backdrop is removed from document');
overlays[0].backdropElement.style.transitionDuration = '';
done(); done();
}); });
}); });
test('backdrop is removed when toggling overlay opened', function(done) {
overlays[0].open();
assert.isObject(overlays[0].backdropElement.parentNode, 'backdrop is immediately inserted in the document');
overlays[0].close();
// Wait a tick (overlay will call backdropElement.close in the _openChangedAsync)
setTimeout(function() {
assert.isFalse(overlays[0].backdropElement.opened, 'backdrop is closed');
assert.isNotObject(overlays[0].backdropElement.parentNode, 'backdrop is removed from document');
done();
}, 1);
});
test('updating with-backdrop updates z-index', function(done) { test('updating with-backdrop updates z-index', function(done) {
runAfterOpen(overlays[0], function() { runAfterOpen(overlays[0], function() {
runAfterOpen(overlays[1], function() { runAfterOpen(overlays[1], function() {

View file

@ -0,0 +1,40 @@
<!--
@license
Copyright (c) 2015 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
-->
<link rel="import" href="../../polymer/polymer.html">
<dom-module id="test-buttons">
<style>
:host {
border: 1px solid black;
padding: 10px;
}
</style>
<template>
<button id="button0">button0</button>
<button id="button1">button1</button>
<button id="button2">button2</button>
</template>
</dom-module>
<script>
(function() {
Polymer({
is: 'test-buttons'
});
})();
</script>

View file

@ -45,7 +45,7 @@
"tag": "v1.0.11", "tag": "v1.0.11",
"commit": "e3c1ab0c72905b58fb4d9adc2921ea73b5c085a5" "commit": "e3c1ab0c72905b58fb4d9adc2921ea73b5c085a5"
}, },
"_source": "git://github.com/PolymerElements/paper-behaviors.git", "_source": "git://github.com/polymerelements/paper-behaviors.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "PolymerElements/paper-behaviors" "_originalSource": "polymerelements/paper-behaviors"
} }

View file

@ -19,7 +19,7 @@
<br /> <br />
<ul data-role="listview" class="ulForm"> <ul data-role="listview" class="ulForm">
<li> <li>
<label for="selectChannelResolution">${LabelChannelStreamQuality}</label> <label for="selectChannelResolution" class="selectLabel">${LabelChannelStreamQuality}</label>
<select id="selectChannelResolution" data-mini="true"> <select id="selectChannelResolution" data-mini="true">
<option value="">${OptionBestAvailableStreamQuality}</option> <option value="">${OptionBestAvailableStreamQuality}</option>
<option value="1920">1080p</option> <option value="1920">1080p</option>

View file

@ -6,7 +6,7 @@
var hasChanges = false; var hasChanges = false;
// These images can be large and we're seeing memory problems in safari // These images can be large and we're seeing memory problems in safari
var browsableImagePageSize = browserInfo.safari ? 6 : (browserInfo.mobile ? 10 : 30); var browsableImagePageSize = browserInfo.safari ? 6 : (browserInfo.mobile ? 10 : 40);
var browsableImageStartIndex = 0; var browsableImageStartIndex = 0;
var browsableImageType = 'Primary'; var browsableImageType = 'Primary';

View file

@ -206,11 +206,14 @@
$('.btnOpenUploadMenu', page).on('click', function () { $('.btnOpenUploadMenu', page).on('click', function () {
var imageType = this.getAttribute('data-imagetype');
require(['components/imageuploader/imageuploader'], function (imageUploader) { require(['components/imageuploader/imageuploader'], function (imageUploader) {
imageUploader.show(currentItem.Id, { imageUploader.show(currentItem.Id, {
theme: options.theme theme: options.theme,
imageType: imageType
}).then(function (hasChanged) { }).then(function (hasChanged) {

View file

@ -13,7 +13,7 @@
<div> <div>
<h1 style="display:inline-block;vertical-align:middle;">${HeaderBackdrops}</h1> <h1 style="display:inline-block;vertical-align:middle;">${HeaderBackdrops}</h1>
<paper-fab icon="search" mini class="btnBrowseAllImages subdued" style="vertical-align:middle;margin-left:1em;" data-imagetype="Backdrop"></paper-fab> <paper-fab icon="search" mini class="btnBrowseAllImages subdued" style="vertical-align:middle;margin-left:1em;" data-imagetype="Backdrop"></paper-fab>
<paper-fab icon="add" mini class="btnOpenUploadMenu subdued" style="vertical-align:middle;margin-left:.25em;"></paper-fab> <paper-fab icon="add" mini class="btnOpenUploadMenu subdued" style="vertical-align:middle;margin-left:.25em;" data-imagetype="Backdrop"></paper-fab>
</div> </div>
<div id="backdrops"> <div id="backdrops">
</div> </div>
@ -24,7 +24,7 @@
<div> <div>
<h1 style="display:inline-block;vertical-align:middle;">${Screenshots}</h1> <h1 style="display:inline-block;vertical-align:middle;">${Screenshots}</h1>
<paper-fab icon="search" mini class="btnBrowseAllImages subdued" style="vertical-align:middle;margin-left:1em;" data-imagetype="Screenshot"></paper-fab> <paper-fab icon="search" mini class="btnBrowseAllImages subdued" style="vertical-align:middle;margin-left:1em;" data-imagetype="Screenshot"></paper-fab>
<paper-fab icon="add" mini class="btnOpenUploadMenu subdued" style="vertical-align:middle;margin-left:.25em;"></paper-fab> <paper-fab icon="add" mini class="btnOpenUploadMenu subdued" style="vertical-align:middle;margin-left:.25em;" data-imagetype="Screenshot"></paper-fab>
</div> </div>
<div id="screenshots"> <div id="screenshots">
</div> </div>

View file

@ -164,6 +164,8 @@
var editorContent = dlg.querySelector('.editorContent'); var editorContent = dlg.querySelector('.editorContent');
initEditor(editorContent); initEditor(editorContent);
$('#selectImageType', dlg).val(options.imageType || 'Primary');
$('.btnCloseDialog', dlg).on('click', function () { $('.btnCloseDialog', dlg).on('click', function () {
paperDialogHelper.close(dlg); paperDialogHelper.close(dlg);

View file

@ -65,15 +65,12 @@
require(['prompt'], function (prompt) { require(['prompt'], function (prompt) {
prompt({ prompt({
text: 'Value:', title: 'Value:'
callback: function (text) { }).then(function (text) {
if (text == '') return; var list = $(source).parents('.editableListviewContainer').find('.paperList');
var parent = $(source).parents('.editableListviewContainer');
var list = parent.find('.paperList');
var items = editableListViewValues(list); var items = editableListViewValues(list);
items.push(text); items.push(text);
populateListView(list[0], items, sortCallback); populateListView(list[0], items, sortCallback);
}
}); });
}); });
} }
@ -82,6 +79,52 @@
$(source).parents('paper-icon-item').remove(); $(source).parents('paper-icon-item').remove();
} }
function editPerson(context, person, index) {
$('#popupEditPerson', context).popup("open");
$('#txtPersonName', context).val(person.Name || '');
$('#selectPersonType', context).val(person.Type || '');
$('#txtPersonRole', context).val(person.Role || '');
if (index == null) {
index = '';
}
$("#fldPersonIndex", context).val(index);
}
function savePersonInfo(page) {
$('#popupEditPerson', page).popup("close");
var index = $("#fldPersonIndex", page).val();
var person;
var isNew = true;
if (index) {
isNew = false;
index = parseInt(index);
person = currentItem.People[index];
} else {
person = {};
}
person.Name = $('#txtPersonName', page).val();
person.Type = $('#selectPersonType', page).val();
person.Role = $('#txtPersonRole', page).val();
if (isNew) {
currentItem.People.push(person);
}
populatePeople(page, currentItem.People);
}
function init(context) { function init(context) {
$('.btnCancel', context).on('click', function () { $('.btnCancel', context).on('click', function () {
@ -89,6 +132,15 @@
closeDialog(false); closeDialog(false);
}); });
context.querySelector('#chkLockData').addEventListener('click', function (e) {
if (!e.target.checked) {
$('.providerSettingsContainer').show();
} else {
$('.providerSettingsContainer').hide();
}
});
context.addEventListener('click', function (e) { context.addEventListener('click', function (e) {
var btnRemoveFromEditorList = parentWithClass(e.target, 'btnRemoveFromEditorList'); var btnRemoveFromEditorList = parentWithClass(e.target, 'btnRemoveFromEditorList');
@ -104,6 +156,11 @@
}); });
$('form', context).off('submit', onSubmit).on('submit', onSubmit); $('form', context).off('submit', onSubmit).on('submit', onSubmit);
$("#btnAddPerson", context).on('click', function (event, data) {
editPerson(context, {});
});
} }
function getItem(itemId) { function getItem(itemId) {
@ -505,9 +562,9 @@
var chkLockData = context.querySelector("#chkLockData"); var chkLockData = context.querySelector("#chkLockData");
chkLockData.checked = lockData; chkLockData.checked = lockData;
if (chkLockData.checked) { if (chkLockData.checked) {
$('#providerSettingsContainer', context).hide(); $('.providerSettingsContainer', context).hide();
} else { } else {
$('#providerSettingsContainer', context).show(); $('.providerSettingsContainer', context).show();
} }
populateInternetProviderSettings(context, item, item.LockedFields); populateInternetProviderSettings(context, item, item.LockedFields);
@ -690,8 +747,6 @@
html += '<paper-icon-button icon="delete" data-index="' + i + '" class="btnRemoveFromEditorList"></paper-icon-button>'; html += '<paper-icon-button icon="delete" data-index="' + i + '" class="btnRemoveFromEditorList"></paper-icon-button>';
html += '</paper-icon-item>'; html += '</paper-icon-item>';
//html += '<li data-mini="true"><a class="data">' + items[i] + '</a><a href="#" onclick="EditItemMetadataPage.removeElementFromListview(this)" class="btnRemoveFromEditorList"></a></li>';
} }
list.innerHTML = html; list.innerHTML = html;
@ -729,7 +784,7 @@
html += '</li>'; html += '</li>';
} }
//elem.html(html).listview('refresh'); //elem.html(html);
$('.btnDeletePerson', elem).on('click', function () { $('.btnDeletePerson', elem).on('click', function () {
@ -762,7 +817,7 @@
} }
function populateInternetProviderSettings(context, item, lockedFields) { function populateInternetProviderSettings(context, item, lockedFields) {
var container = $('#providerSettingsContainer', context); var container = $('.providerSettingsContainer', context);
lockedFields = lockedFields || new Array(); lockedFields = lockedFields || new Array();
var metadatafields = [ var metadatafields = [

View file

@ -10,7 +10,7 @@
<div style="padding: 0 0 10px;"> <div style="padding: 0 0 10px;">
<div id="fldContentType" style="display:none;"> <div id="fldContentType" style="display:none;">
<label for="selectContentType">${LabelContentType}</label> <label for="selectContentType" class="selectLabel">${LabelContentType}</label>
<select id="selectContentType" data-mini="true"></select> <select id="selectContentType" data-mini="true"></select>
</div> </div>
<div id="fldPath"> <div id="fldPath">
@ -26,7 +26,7 @@
<paper-input id="txtDateAdded" type="date" label="${LabelDateAdded}"></paper-input> <paper-input id="txtDateAdded" type="date" label="${LabelDateAdded}"></paper-input>
</div> </div>
<div id="fldStatus" style="display: none;margin:1em 0;"> <div id="fldStatus" style="display: none;margin:1em 0;">
<label for="selectStatus">${LabelStatus}</label> <label for="selectStatus" class="selectLabel">${LabelStatus}</label>
<select id="selectStatus" data-mini="true"></select> <select id="selectStatus" data-mini="true"></select>
</div> </div>
<div id="fldArtist" style="display: none;"> <div id="fldArtist" style="display: none;">
@ -111,12 +111,12 @@
</div> </div>
<div id="fldOfficialRating" style="display: none;"> <div id="fldOfficialRating" style="display: none;">
<br /> <br />
<label for="selectOfficialRating">${LabelParentalRating}</label> <label for="selectOfficialRating" class="selectLabel">${LabelParentalRating}</label>
<select id="selectOfficialRating" data-mini="true"></select> <select id="selectOfficialRating" data-mini="true"></select>
</div> </div>
<div id="fldCustomRating" style="display: none;"> <div id="fldCustomRating" style="display: none;">
<br /> <br />
<label for="selectCustomRating">${LabelCustomRating}</label> <label for="selectCustomRating" class="selectLabel">${LabelCustomRating}</label>
<select id="selectCustomRating" data-mini="true"></select> <select id="selectCustomRating" data-mini="true"></select>
</div> </div>
<div id="fldBudget" style="display: none;"> <div id="fldBudget" style="display: none;">
@ -133,7 +133,7 @@
</div> </div>
<div id="fld3dFormat" style="display: none;"> <div id="fld3dFormat" style="display: none;">
<br /> <br />
<label for="select3dFormat">${Label3DFormat}</label> <label for="select3dFormat" class="selectLabel">${Label3DFormat}</label>
<select id="select3dFormat" data-mini="true"> <select id="select3dFormat" data-mini="true">
<option value=""></option> <option value=""></option>
<option value="HalfSideBySide">HSBS</option> <option value="HalfSideBySide">HSBS</option>
@ -202,7 +202,7 @@
<paper-checkbox id="chkDisplaySpecialsInline">${LabelDisplaySpecialsWithinSeasons}</paper-checkbox> <paper-checkbox id="chkDisplaySpecialsInline">${LabelDisplaySpecialsWithinSeasons}</paper-checkbox>
</div> </div>
<div id="fldDisplayOrder" class="fldDisplaySetting"> <div id="fldDisplayOrder" class="fldDisplaySetting">
<label for="selectDisplayOrder" id="labelDisplayOrder">${LabelDisplayOrder}</label> <label for="selectDisplayOrder" class="selectLabel" id="labelDisplayOrder">${LabelDisplayOrder}</label>
<select id="selectDisplayOrder" data-mini="true"></select> <select id="selectDisplayOrder" data-mini="true"></select>
</div> </div>
</div> </div>
@ -274,23 +274,23 @@
<h1>${HeaderMetadataSettings}</h1> <h1>${HeaderMetadataSettings}</h1>
<div> <div>
<div> <div>
<label for="selectLanguage">${LabelMetadataDownloadLanguage}</label> <label for="selectLanguage" class="selectLabel">${LabelMetadataDownloadLanguage}</label>
<select id="selectLanguage" data-mini="true"></select> <select id="selectLanguage" data-mini="true"></select>
</div> </div>
<div class="fieldDescription editorfieldDescription">${MessageLeaveEmptyToInherit}</div> <div class="fieldDescription editorfieldDescription">${MessageLeaveEmptyToInherit}</div>
<br /> <br />
<div> <div>
<label for="selectCountry">${LabelCountry}</label> <label for="selectCountry" class="selectLabel">${LabelCountry}</label>
<select id="selectCountry" data-mini="true"></select> <select id="selectCountry" data-mini="true"></select>
</div> </div>
<div class="fieldDescription editorfieldDescription">${MessageLeaveEmptyToInherit}</div> <div class="fieldDescription editorfieldDescription">${MessageLeaveEmptyToInherit}</div>
<div> <div>
<br /><br /> <br /><br />
<paper-checkbox id="chkLockData" onchange="EditItemMetadataPage.setProviderSettingsContainerVisibility(this)">${LabelLockItemToPreventChanges}</paper-checkbox> <paper-checkbox id="chkLockData">${LabelLockItemToPreventChanges}</paper-checkbox>
</div> </div>
<br /> <br />
<div id="providerSettingsContainer" style="display: none"> <div class="providerSettingsContainer" style="display: none">
</div> </div>
</div> </div>
</div> </div>

View file

@ -41,7 +41,7 @@
<div> <div>
<div> <div>
<br /> <br />
<label for="selectCountry">${LabelCountry}</label> <label for="selectCountry" class="selectLabel">${LabelCountry}</label>
<select id="selectCountry" data-mini="true" required="required"></select> <select id="selectCountry" data-mini="true" required="required"></select>
</div> </div>
<div> <div>
@ -49,7 +49,7 @@
</div> </div>
<div> <div>
<br /> <br />
<label for="selectListing">${LabelLineup}</label> <label for="selectListing" class="selectLabel">${LabelLineup}</label>
<select id="selectListing" data-mini="true" required="required"></select> <select id="selectListing" data-mini="true" required="required"></select>
</div> </div>
<div> <div>

View file

@ -114,7 +114,7 @@
height: 80px; height: 80px;
background-position: center center; background-position: center center;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: contain;
} }
.nowPlayingBarText { .nowPlayingBarText {

View file

@ -1,4 +1,255 @@
/* cyrillic-ext */ /* Swatches */
/* A
-----------------------------------------------------------------------------------------------------------*/
/* Bar: Toolbars, dividers, slider track */
.ui-bar-a,
.ui-page-theme-a .ui-bar-inherit,
html .ui-bar-a .ui-bar-inherit,
html .ui-body-a .ui-bar-inherit,
html body .ui-group-theme-a .ui-bar-inherit {
background-color: #e9e9e9 /*{a-bar-background-color}*/;
border-color: #ddd /*{a-bar-border}*/;
color: #333 /*{a-bar-color}*/;
font-weight: bold;
}
.ui-bar-a {
border-width: 1px;
border-style: solid;
}
/* Page and overlay */
.ui-page-theme-a .ui-panel-wrapper {
background-color: #f9f9f9 /*{a-page-background-color}*/;
border-color: #bbb /*{a-page-border}*/;
color: #333 /*{a-page-color}*/;
}
/* Body: Read-only lists, text inputs, collapsible content */
.ui-page-theme-a .ui-body-inherit,
html .ui-bar-a .ui-body-inherit,
html .ui-body-a .ui-body-inherit,
html body .ui-group-theme-a .ui-body-inherit,
html .ui-panel-page-container-a {
background-color: #fff /*{a-body-background-color}*/;
border-color: #ddd /*{a-body-border}*/;
color: #333 /*{a-body-color}*/;
}
/* Links */
.ui-page-theme-a a,
html .ui-bar-a a,
html .ui-body-a a,
html body .ui-group-theme-a a {
color: #3388cc /*{a-link-color}*/;
font-weight: bold;
}
.ui-page-theme-a a:visited,
html .ui-bar-a a:visited,
html .ui-body-a a:visited,
html body .ui-group-theme-a a:visited {
color: #3388cc /*{a-link-visited}*/;
}
.ui-page-theme-a a:hover,
html .ui-bar-a a:hover,
html .ui-body-a a:hover,
html body .ui-group-theme-a a:hover {
color: #005599 /*{a-link-hover}*/;
}
.ui-page-theme-a a:active,
html .ui-bar-a a:active,
html .ui-body-a a:active,
html body .ui-group-theme-a a:active {
color: #005599 /*{a-link-active}*/;
}
/* Button up */
.ui-page-theme-a .ui-btn,
html .ui-bar-a .ui-btn,
html .ui-body-a .ui-btn,
html body .ui-group-theme-a .ui-btn,
html head + body .ui-btn.ui-btn-a,
/* Button visited */
.ui-page-theme-a .ui-btn:visited,
html .ui-bar-a .ui-btn:visited,
html .ui-body-a .ui-btn:visited,
html body .ui-group-theme-a .ui-btn:visited,
html head + body .ui-btn.ui-btn-a:visited,
ul[data-role="listview"] a + a {
background-color: #f6f6f6 /*{a-bup-background-color}*/;
border-color: #ddd /*{a-bup-border}*/;
color: #333 /*{a-bup-color}*/;
}
/* Button hover */
.ui-page-theme-a .ui-btn:hover,
html .ui-bar-a .ui-btn:hover,
html .ui-body-a .ui-btn:hover,
html body .ui-group-theme-a .ui-btn:hover,
html head + body .ui-btn.ui-btn-a:hover {
background-color: #ededed /*{a-bhover-background-color}*/;
border-color: #ddd /*{a-bhover-border}*/;
color: #333 /*{a-bhover-color}*/;
}
/* Button down */
.ui-page-theme-a .ui-btn:active,
html .ui-bar-a .ui-btn:active,
html .ui-body-a .ui-btn:active,
html body .ui-group-theme-a .ui-btn:active,
html head + body .ui-btn.ui-btn-a:active {
background-color: #e8e8e8 /*{a-bdown-background-color}*/;
border-color: #ddd /*{a-bdown-border}*/;
color: #333 /*{a-bdown-color}*/;
}
/* Active button */
.ui-page-theme-a .ui-btn.ui-btn-active,
html .ui-bar-a .ui-btn.ui-btn-active,
html .ui-body-a .ui-btn.ui-btn-active,
html body .ui-group-theme-a .ui-btn.ui-btn-active,
html head + body .ui-btn.ui-btn-a.ui-btn-active,
/* Active checkbox icon */
.ui-page-theme-a .ui-checkbox-on:after,
html .ui-bar-a .ui-checkbox-on:after,
html .ui-body-a .ui-checkbox-on:after,
html body .ui-group-theme-a .ui-checkbox-on:after,
.ui-btn.ui-checkbox-on.ui-btn-a:after {
background-color: #3388cc /*{a-active-background-color}*/;
border-color: #3388cc /*{a-active-border}*/;
color: #fff /*{a-active-color}*/;
}
/* Active radio button icon */
.ui-page-theme-a .ui-radio-on:after,
html .ui-bar-a .ui-radio-on:after,
html .ui-body-a .ui-radio-on:after,
html body .ui-group-theme-a .ui-radio-on:after,
.ui-btn.ui-radio-on.ui-btn-a:after {
border-color: #3388cc /*{a-active-background-color}*/;
}
/* B
-----------------------------------------------------------------------------------------------------------*/
/* Bar: Toolbars, dividers, slider track */
.ui-bar-b,
.ui-page-theme-b .ui-bar-inherit,
html .ui-bar-b .ui-bar-inherit,
html .ui-body-b .ui-bar-inherit,
html body .ui-group-theme-b .ui-bar-inherit {
background-color: #1d1d1d /*{b-bar-background-color}*/;
border-color: #1b1b1b /*{b-bar-border}*/;
color: #fff /*{b-bar-color}*/;
font-weight: bold;
}
.ui-bar-b {
border-width: 1px;
border-style: solid;
}
/* Page and overlay */
.ui-page-theme-b .ui-panel-wrapper {
background-color: #252525 /*{b-page-background-color}*/;
border-color: #454545 /*{b-page-border}*/;
color: #fff /*{b-page-color}*/;
}
/* Body: Read-only lists, text inputs, collapsible content */
.ui-page-theme-b .ui-body-inherit,
html .ui-bar-b .ui-body-inherit,
html .ui-body-b .ui-body-inherit,
html body .ui-group-theme-b .ui-body-inherit,
html .ui-panel-page-container-b {
background-color: #2a2a2a /*{b-body-background-color}*/;
border-color: #1d1d1d /*{b-body-border}*/;
color: #fff /*{b-body-color}*/;
}
/* Links */
.ui-body-b a {
color: #22aadd /*{b-link-color}*/;
font-weight: bold;
}
.ui-body-b a:visited {
color: #22aadd /*{b-link-visited}*/;
}
.ui-body-b a:hover {
color: #0088bb /*{b-link-hover}*/;
}
.ui-body-b a:active {
color: #0088bb /*{b-link-active}*/;
}
/* Button up */
.ui-page-theme-b .ui-btn,
html .ui-bar-b .ui-btn,
html .ui-body-b .ui-btn,
html body .ui-group-theme-b .ui-btn,
html head + body .ui-btn.ui-btn-b,
/* Button visited */
.ui-page-theme-b .ui-btn:visited,
html .ui-bar-b .ui-btn:visited,
html .ui-body-b .ui-btn:visited,
html body .ui-group-theme-b .ui-btn:visited,
html head + body .ui-btn.ui-btn-b:visited {
background-color: #333 /*{b-bup-background-color}*/;
border-color: #1f1f1f /*{b-bup-border}*/;
color: #fff /*{b-bup-color}*/;
}
/* Button hover */
.ui-page-theme-b .ui-btn:hover,
html .ui-bar-b .ui-btn:hover,
html .ui-body-b .ui-btn:hover,
html body .ui-group-theme-b .ui-btn:hover,
html head + body .ui-btn.ui-btn-b:hover {
background-color: #373737 /*{b-bhover-background-color}*/;
border-color: #1f1f1f /*{b-bhover-border}*/;
color: #fff /*{b-bhover-color}*/;
}
/* Button down */
.ui-page-theme-b .ui-btn:active,
html .ui-bar-b .ui-btn:active,
html .ui-body-b .ui-btn:active,
html body .ui-group-theme-b .ui-btn:active,
html head + body .ui-btn.ui-btn-b:active {
background-color: #404040 /*{b-bdown-background-color}*/;
border-color: #1f1f1f /*{b-bdown-border}*/;
color: #fff /*{b-bdown-color}*/;
}
/* Active button */
.ui-page-theme-b .ui-btn.ui-btn-active,
html .ui-bar-b .ui-btn.ui-btn-active,
html .ui-body-b .ui-btn.ui-btn-active,
html body .ui-group-theme-b .ui-btn.ui-btn-active,
html head + body .ui-btn.ui-btn-b.ui-btn-active,
/* Active checkbox icon */
.ui-page-theme-b .ui-checkbox-on:after,
html .ui-bar-b .ui-checkbox-on:after,
html .ui-body-b .ui-checkbox-on:after,
html body .ui-group-theme-b .ui-checkbox-on:after,
.ui-btn.ui-checkbox-on.ui-btn-b:after {
background-color: #22aadd /*{b-active-background-color}*/;
border-color: #22aadd /*{b-active-border}*/;
color: #fff /*{b-active-color}*/;
}
/* Active radio button icon */
.ui-page-theme-b .ui-radio-on:after,
html .ui-bar-b .ui-radio-on:after,
html .ui-body-b .ui-radio-on:after,
html body .ui-group-theme-b .ui-radio-on:after,
.ui-btn.ui-radio-on.ui-btn-b:after {
border-color: #22aadd /*{b-active-background-color}*/;
}
/* cyrillic-ext */
@font-face { @font-face {
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
@ -808,7 +1059,6 @@ h1 .imageLink {
} }
.fieldDescription { .fieldDescription {
font-size: 12px;
padding-left: 5px; padding-left: 5px;
font-weight: normal; font-weight: normal;
white-space: normal !important; white-space: normal !important;
@ -836,13 +1086,13 @@ paper-input + .fieldDescription {
} }
.ulForm { .ulForm {
margin: -1em !important;
margin-bottom: 20px !important; margin-bottom: 20px !important;
} }
.ulForm li:not(.ui-li-divider) { .ulForm li:not(.ui-li-divider) {
background: none; background: none;
border-top: none; border: 0 !important;
border-bottom: none;
} }
.popup .ulForm { .popup .ulForm {

View file

@ -4,7 +4,7 @@
<title>Emby</title> <title>Emby</title>
</head> </head>
<body> <body>
<div id="dashboardPage" data-role="page" class="page type-interior dashboardHomePage" data-require="scripts/dashboardpage,humanedate,buttonenabled,paper-icon-item,paper-item-body,paper-fab"> <div id="dashboardPage" data-role="page" class="page type-interior dashboardHomePage" data-require="jqmcollapsible,scripts/dashboardpage,humanedate,buttonenabled,paper-icon-item,paper-item-body,paper-fab">
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">

View file

@ -4,7 +4,7 @@
<title>${TitleServer}</title> <title>${TitleServer}</title>
</head> </head>
<body> <body>
<div id="dashboardGeneralPage" data-role="page" class="page type-interior dashboardHomePage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Server%20Settings" data-require="scripts/dashboardgeneral,paper-textarea,paper-input"> <div id="dashboardGeneralPage" data-role="page" class="page type-interior dashboardHomePage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Server%20Settings" data-require="jqmcollapsible,scripts/dashboardgeneral,paper-textarea,paper-input">
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">
@ -23,7 +23,7 @@
</div> </div>
<br /><br /> <br /><br />
<div> <div>
<label for="selectLocalizationLanguage">${LabelPreferredDisplayLanguage}</label> <label for="selectLocalizationLanguage" class="selectLabel">${LabelPreferredDisplayLanguage}</label>
<select id="selectLocalizationLanguage" data-mini="true"></select> <select id="selectLocalizationLanguage" data-mini="true"></select>
<div class="fieldDescription"> <div class="fieldDescription">
<div>${LabelPreferredDisplayLanguageHelp}</div> <div>${LabelPreferredDisplayLanguageHelp}</div>

View file

@ -4,7 +4,7 @@
<title>${TitleDlna}</title> <title>${TitleDlna}</title>
</head> </head>
<body> <body>
<div id="dlnaProfilePage" data-role="page" class="page type-interior dlnaPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Dlna%20profiles" data-require="jqmpopup,scripts/dlnaprofile"> <div id="dlnaProfilePage" data-role="page" class="page type-interior dlnaPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Dlna%20profiles" data-require="jqmcollapsible,jqmpopup,scripts/dlnaprofile">
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">
@ -19,18 +19,12 @@
<p>${HeaderProfileInformation}</p> <p>${HeaderProfileInformation}</p>
<div data-role="controlgroup" data-type="horizontal" data-mini="true"> <div data-role="controlgroup" data-type="horizontal" data-mini="true">
<input type="radio" name="radioProfileTab" class="radioTabButton" id="radioInfo" value="tabInfo"> <a href="#" data-role="button" class="radioTabButton" id="radioInfo" data-value="tabInfo">${TabInfo}</a>
<label for="radioInfo">${TabInfo}</label> <a href="#" data-role="button" class="radioTabButton" id="radioDirectPlay" data-value="tabDirectPlayProfiles">${TabDirectPlay}</a>
<input type="radio" name="radioProfileTab" class="radioTabButton" id="radioDirectPlay" value="tabDirectPlayProfiles"> <a href="#" data-role="button" class="radioTabButton" id="radioTranscoding" data-value="tabTranscodingProfiles">${TabTranscoding}</a>
<label for="radioDirectPlay">${TabDirectPlay}</label> <a href="#" data-role="button" class="radioTabButton" id="radioContainers" data-value="tabContainerProfiles">${TabContainers}</a>
<input type="radio" name="radioProfileTab" class="radioTabButton" id="radioTranscoding" value="tabTranscodingProfiles"> <a href="#" data-role="button" class="radioTabButton" id="radioCodecs" data-value="tabCodecProfiles">${TabCodecs}</a>
<label for="radioTranscoding">${TabTranscoding}</label> <a href="#" data-role="button" class="radioTabButton" id="radioMediaProfiles" data-value="tabMediaProfiles">${TabResponses}</a>
<input type="radio" name="radioProfileTab" class="radioTabButton" id="radioContainers" value="tabContainerProfiles">
<label for="radioContainers">${TabContainers}</label>
<input type="radio" name="radioProfileTab" class="radioTabButton" id="radioCodecs" value="tabCodecProfiles">
<label for="radioCodecs">${TabCodecs}</label>
<input type="radio" name="radioProfileTab" class="radioTabButton" id="radioMediaProfiles" value="tabMediaProfiles">
<label for="radioMediaProfiles">${TabResponses}</label>
</div> </div>
<br /> <br />
<div class="tabContent tabInfo"> <div class="tabContent tabInfo">

View file

@ -20,7 +20,7 @@
<ul data-role="listview" class="ulForm"> <ul data-role="listview" class="ulForm">
<li> <li>
<label for="selectVideoDecoder">${LabelHardwareAccelerationType}</label> <label for="selectVideoDecoder" class="selectLabel">${LabelHardwareAccelerationType}</label>
<select id="selectVideoDecoder" data-mini="true"> <select id="selectVideoDecoder" data-mini="true">
<option value="">${OptionAuto}</option> <option value="">${OptionAuto}</option>
<option value="qsv">Intel Quick Sync</option> <option value="qsv">Intel Quick Sync</option>
@ -28,7 +28,7 @@
<div class="fieldDescription">${LabelHardwareAccelerationTypeHelp}</div> <div class="fieldDescription">${LabelHardwareAccelerationTypeHelp}</div>
</li> </li>
<li> <li>
<label for="selectThreadCount">${LabelTranscodingThreadCount}</label> <label for="selectThreadCount" class="selectLabel">${LabelTranscodingThreadCount}</label>
<select id="selectThreadCount" data-mini="true"> <select id="selectThreadCount" data-mini="true">
<option value="-1">${OptionAuto}</option> <option value="-1">${OptionAuto}</option>
<option value="1">1</option> <option value="1">1</option>

View file

@ -4,7 +4,7 @@
<title>${TitleMediaLibrary}</title> <title>${TitleMediaLibrary}</title>
</head> </head>
<body> <body>
<div id="libraryPathMappingPage" data-role="page" class="page type-interior librarySectionPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Library%20setup" data-require="jqmtable,scripts/librarypathmapping"> <div id="libraryPathMappingPage" data-role="page" class="page type-interior librarySectionPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Library%20setup" data-require="scripts/librarypathmapping">
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">
@ -17,16 +17,7 @@
<div class="readOnlyContent"> <div class="readOnlyContent">
<p>${PathSubstitutionHelp}</p> <p>${PathSubstitutionHelp}</p>
<table id="tblPaths" data-role="table" data-mode="reflow" class="ui-responsive"> <div class="pathSubstitutions"></div>
<thead>
<tr>
<th>${HeaderFrom}</th>
<th>${HeaderTo}</th>
<th></th>
</tr>
</thead>
<tbody class="tbodyPathSubstitutions"></tbody>
</table>
</div> </div>
<br /> <br />

View file

@ -4,7 +4,7 @@
<title>${TitleMediaLibrary}</title> <title>${TitleMediaLibrary}</title>
</head> </head>
<body> <body>
<div id="librarySettingsPage" data-role="page" class="page type-interior librarySectionPage" data-require="scripts/librarysettings"> <div id="librarySettingsPage" data-role="page" class="page type-interior librarySectionPage" data-require="jqmcollapsible,scripts/librarysettings">
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">

View file

@ -19,7 +19,7 @@
<ul data-role="listview" class="ulForm"> <ul data-role="listview" class="ulForm">
<li> <li>
<label for="selectGuideDays">${LabelNumberOfGuideDays}</label> <label for="selectGuideDays" class="selectLabel">${LabelNumberOfGuideDays}</label>
<select id="selectGuideDays" data-mini="true"> <select id="selectGuideDays" data-mini="true">
<option value="">${OptionAutomatic}</option> <option value="">${OptionAutomatic}</option>
<option value="1">1</option> <option value="1">1</option>

View file

@ -30,7 +30,7 @@
<div class="fieldDescription">${LabelSaveLocalMetadataHelp}</div> <div class="fieldDescription">${LabelSaveLocalMetadataHelp}</div>
</li> </li>
<li style="display:none;"> <li style="display:none;">
<label for="selectImageSavingConvention">${LabelImageSavingConvention}</label> <label for="selectImageSavingConvention" class="selectLabel">${LabelImageSavingConvention}</label>
<select name="selectImageSavingConvention" id="selectImageSavingConvention" data-mini="true"> <select name="selectImageSavingConvention" id="selectImageSavingConvention" data-mini="true">
<option value="Compatible">${OptionImageSavingCompatible}</option> <option value="Compatible">${OptionImageSavingCompatible}</option>
<option value="Legacy">${OptionImageSavingStandard}</option> <option value="Legacy">${OptionImageSavingStandard}</option>
@ -38,11 +38,11 @@
<div class="fieldDescription">${LabelImageSavingConventionHelp}</div> <div class="fieldDescription">${LabelImageSavingConventionHelp}</div>
</li> </li>
<li> <li>
<label for="selectLanguage">${LabelMetadataDownloadLanguage}</label> <label for="selectLanguage" class="selectLabel">${LabelMetadataDownloadLanguage}</label>
<select name="selectLanguage" id="selectLanguage" data-mini="true" required="required"></select> <select name="selectLanguage" id="selectLanguage" data-mini="true" required="required"></select>
</li> </li>
<li> <li>
<label for="selectCountry">${LabelCountry}</label> <label for="selectCountry" class="selectLabel">${LabelCountry}</label>
<select name="selectCountry" id="selectCountry" data-mini="true" required="required"></select> <select name="selectCountry" id="selectCountry" data-mini="true" required="required"></select>
</li> </li>
<li> <li>

View file

@ -4,7 +4,7 @@
<title>${TitleMetadata}</title> <title>${TitleMetadata}</title>
</head> </head>
<body> <body>
<div id="advancedMetadataConfigurationPage" data-role="page" class="page type-interior metadataConfigurationPage" data-require="scripts/metadataadvanced,paper-checkbox,paper-input"> <div id="advancedMetadataConfigurationPage" data-role="page" class="page type-interior metadataConfigurationPage" data-require="jqmcollapsible,scripts/metadataadvanced,paper-checkbox,paper-input">
<div data-role="content"> <div data-role="content">
@ -31,7 +31,7 @@
<input type="checkbox" id="chkSaveMetadataHidden" data-mini="true" /> <input type="checkbox" id="chkSaveMetadataHidden" data-mini="true" />
</li> </li>
<li> <li>
<label for="selectDateAdded">${LabelDateAddedBehavior}</label> <label for="selectDateAdded" class="selectLabel">${LabelDateAddedBehavior}</label>
<select id="selectDateAdded" data-mini="true"> <select id="selectDateAdded" data-mini="true">
<option value="0">${OptionDateAddedImportTime}</option> <option value="0">${OptionDateAddedImportTime}</option>
<option value="1">${OptionDateAddedFileTime}</option> <option value="1">${OptionDateAddedFileTime}</option>

View file

@ -4,7 +4,7 @@
<title>${TitleMetadata}</title> <title>${TitleMetadata}</title>
</head> </head>
<body> <body>
<div id="metadataImagesConfigurationPage" data-role="page" class="page type-interior metadataConfigurationPage" data-require="scripts/metadataimagespage"> <div id="metadataImagesConfigurationPage" data-role="page" class="page type-interior metadataConfigurationPage" data-require="jqmcollapsible,scripts/metadataimagespage">
<div data-role="content"> <div data-role="content">
@ -21,7 +21,7 @@
<form class="metadataImagesConfigurationForm" style="margin-top: 10px; max-width: 800px;"> <form class="metadataImagesConfigurationForm" style="margin-top: 10px; max-width: 800px;">
<br /> <br />
<div style="width: 75%;"> <div style="width: 75%;">
<label for="selectItemType">${LabelCustomizeOptionsPerMediaType}</label> <label for="selectItemType" class="selectLabel">${LabelCustomizeOptionsPerMediaType}</label>
<select id="selectItemType" data-mini="true"></select> <select id="selectItemType" data-mini="true"></select>
</div> </div>
<br /> <br />

View file

@ -24,13 +24,13 @@
<ul class="ulForm" data-role="listview"> <ul class="ulForm" data-role="listview">
<li> <li>
<label for="selectUser">${LabelKodiMetadataUser}</label> <label for="selectUser" class="selectLabel">${LabelKodiMetadataUser}</label>
<select name="selectUser" id="selectUser" data-mini="true"></select> <select name="selectUser" id="selectUser" data-mini="true"></select>
<div class="fieldDescription">${LabelKodiMetadataUserHelp}</div> <div class="fieldDescription">${LabelKodiMetadataUserHelp}</div>
</li> </li>
<li> <li>
<label for="selectReleaseDateFormat">${LabelKodiMetadataDateFormat}</label> <label for="selectReleaseDateFormat" class="selectLabel">${LabelKodiMetadataDateFormat}</label>
<select name="selectReleaseDateFormat" id="selectReleaseDateFormat" data-mini="true"> <select name="selectReleaseDateFormat" id="selectReleaseDateFormat" data-mini="true">
<option value="yyyy-MM-dd">yyyy-MM-dd</option> <option value="yyyy-MM-dd">yyyy-MM-dd</option>
</select> </select>

View file

@ -18,7 +18,7 @@
<div class="detailSectionContent"> <div class="detailSectionContent">
<br /> <br />
<div> <div>
<label for="selectLanguage">${LabelPreferredDisplayLanguage}</label> <label for="selectLanguage" class="selectLabel">${LabelPreferredDisplayLanguage}</label>
<select id="selectLanguage" data-mini="true"> <select id="selectLanguage" data-mini="true">
<option value="ar">Arabic</option> <option value="ar">Arabic</option>
<option value="bg-BG">Bulgarian (Bulgaria)</option> <option value="bg-BG">Bulgarian (Bulgaria)</option>
@ -72,7 +72,7 @@
<div class="detailSectionContent"> <div class="detailSectionContent">
<br /> <br />
<div> <div>
<label for="selectThemeSong">${LabelEnableThemeSongs}</label> <label for="selectThemeSong" class="selectLabel">${LabelEnableThemeSongs}</label>
<select id="selectThemeSong" data-mini="true"> <select id="selectThemeSong" data-mini="true">
<option value="">${OptionAuto}</option> <option value="">${OptionAuto}</option>
<option value="1">${OptionYes}</option> <option value="1">${OptionYes}</option>
@ -82,7 +82,7 @@
</div> </div>
<br /> <br />
<div class="fldEnableBackdrops" style="display:none;"> <div class="fldEnableBackdrops" style="display:none;">
<label for="selectBackdrop">${LabelEnableBackdrops}</label> <label for="selectBackdrop" class="selectLabel">${LabelEnableBackdrops}</label>
<select id="selectBackdrop" data-mini="true"> <select id="selectBackdrop" data-mini="true">
<option value="">${OptionAuto}</option> <option value="">${OptionAuto}</option>
<option value="1">${OptionYes}</option> <option value="1">${OptionYes}</option>

View file

@ -18,7 +18,7 @@
<div class="detailSectionContent"> <div class="detailSectionContent">
<br /> <br />
<div> <div>
<label for="selectHomeSection1">${LabelHomePageSection1}</label> <label for="selectHomeSection1" class="selectLabel">${LabelHomePageSection1}</label>
<select id="selectHomeSection1" data-mini="true"> <select id="selectHomeSection1" data-mini="true">
<option value="">${OptionAuto}</option> <option value="">${OptionAuto}</option>
<option value="latestmedia">${OptionLatestMedia}</option> <option value="latestmedia">${OptionLatestMedia}</option>
@ -32,7 +32,7 @@
</div> </div>
<br /> <br />
<div> <div>
<label for="selectHomeSection2">${LabelHomePageSection2}</label> <label for="selectHomeSection2" class="selectLabel">${LabelHomePageSection2}</label>
<select id="selectHomeSection2" data-mini="true"> <select id="selectHomeSection2" data-mini="true">
<option value="">${OptionAuto}</option> <option value="">${OptionAuto}</option>
<option value="latestmedia">${OptionLatestMedia}</option> <option value="latestmedia">${OptionLatestMedia}</option>
@ -47,7 +47,7 @@
</div> </div>
<br /> <br />
<div> <div>
<label for="selectHomeSection3">${LabelHomePageSection3}</label> <label for="selectHomeSection3" class="selectLabel">${LabelHomePageSection3}</label>
<select id="selectHomeSection3" data-mini="true"> <select id="selectHomeSection3" data-mini="true">
<option value="">${OptionAuto}</option> <option value="">${OptionAuto}</option>
<option value="latestmedia">${OptionLatestMedia}</option> <option value="latestmedia">${OptionLatestMedia}</option>
@ -62,7 +62,7 @@
</div> </div>
<br /> <br />
<div> <div>
<label for="selectHomeSection4">${LabelHomePageSection4}</label> <label for="selectHomeSection4" class="selectLabel">${LabelHomePageSection4}</label>
<select id="selectHomeSection4" data-mini="true"> <select id="selectHomeSection4" data-mini="true">
<option value="">${OptionAuto}</option> <option value="">${OptionAuto}</option>
<option value="latestmedia">${OptionLatestMedia}</option> <option value="latestmedia">${OptionLatestMedia}</option>

View file

@ -19,19 +19,19 @@
<div class="detailSectionContent"> <div class="detailSectionContent">
<br /> <br />
<div> <div>
<label for="selectAudioLanguage">${LabelAudioLanguagePreference}</label> <label for="selectAudioLanguage" class="selectLabel">${LabelAudioLanguagePreference}</label>
<select id="selectAudioLanguage" data-mini="true"></select> <select id="selectAudioLanguage" data-mini="true"></select>
</div> </div>
<br /> <br />
<paper-checkbox class="chkPlayDefaultAudioTrack">${LabelPlayDefaultAudioTrack}</paper-checkbox> <paper-checkbox class="chkPlayDefaultAudioTrack">${LabelPlayDefaultAudioTrack}</paper-checkbox>
<br /><br /><br /> <br /><br /><br />
<div> <div>
<label for="selectSubtitleLanguage">${LabelSubtitleLanguagePreference}</label> <label for="selectSubtitleLanguage" class="selectLabel">${LabelSubtitleLanguagePreference}</label>
<select id="selectSubtitleLanguage" data-mini="true"></select> <select id="selectSubtitleLanguage" data-mini="true"></select>
</div> </div>
<br /> <br />
<div> <div>
<label for="selectSubtitlePlaybackMode">${LabelSubtitlePlaybackMode}</label> <label for="selectSubtitlePlaybackMode" class="selectLabel">${LabelSubtitlePlaybackMode}</label>
<select id="selectSubtitlePlaybackMode" data-mini="true"> <select id="selectSubtitlePlaybackMode" data-mini="true">
<option value="Default">${OptionDefaultSubtitles}</option> <option value="Default">${OptionDefaultSubtitles}</option>
<option value="Smart">${OptionSmartSubtitles}</option> <option value="Smart">${OptionSmartSubtitles}</option>
@ -68,12 +68,12 @@
<div class="detailSectionContent"> <div class="detailSectionContent">
<br /> <br />
<div> <div>
<label for="selectMaxBitrate">${LabelMaxStreamingBitrate}</label> <label for="selectMaxBitrate" class="selectLabel">${LabelMaxStreamingBitrate}</label>
<select id="selectMaxBitrate" data-mini="true"></select> <select id="selectMaxBitrate" data-mini="true"></select>
</div> </div>
<br /> <br />
<div> <div>
<label for="selectMaxChromecastBitrate">${LabelMaxChromecastBitrate}</label> <label for="selectMaxChromecastBitrate" class="selectLabel">${LabelMaxChromecastBitrate}</label>
<select id="selectMaxChromecastBitrate" data-mini="true"> <select id="selectMaxChromecastBitrate" data-mini="true">
</select> </select>
</div> </div>

View file

@ -4,7 +4,7 @@
<title>${TitlePlayback}</title> <title>${TitlePlayback}</title>
</head> </head>
<body> <body>
<div id="playbackConfigurationPage" data-role="page" class="page type-interior playbackConfigurationPage" data-require="scripts/playbackconfiguration"> <div id="playbackConfigurationPage" data-role="page" class="page type-interior playbackConfigurationPage" data-require="jqmcollapsible,scripts/playbackconfiguration">
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">

View file

@ -11,12 +11,17 @@
<div class="readOnlyContent"> <div class="readOnlyContent">
<h2 class="taskName"></h2> <h2 class="taskName"></h2>
<p id="pTaskDescription"></p> <p id="pTaskDescription"></p>
<p> <div>
<button type="button" data-icon="plus" onclick="ScheduledTaskPage.showAddTriggerPopup();"> <br />
${ButtonAddScheduledTaskTrigger} <h1 style="margin: .6em 0; vertical-align: middle; display: inline-block;">
</button> ${HeaderTaskTriggers}
</p> </h1>
<ul id="ulTaskTriggers" data-role="listview" data-inset="true" data-auto-enhanced="false" data-split-icon="minus"></ul> <paper-button raised class="btnInvite submit mini" style="margin-left: 1em;" title="${ButtonAddScheduledTaskTrigger}" onclick="ScheduledTaskPage.showAddTriggerPopup();">
<iron-icon icon="add"></iron-icon>
<span>${ButtonAdd}</span>
</paper-button>
</div>
<div class="taskTriggers"></div>
</div> </div>
</div> </div>
</div> </div>
@ -26,10 +31,10 @@
<h3>${HeaderAddScheduledTaskTrigger}</h3> <h3>${HeaderAddScheduledTaskTrigger}</h3>
</div> </div>
<div data-role="content"> <div data-role="content">
<br />
<ul data-role="listview" class="ulForm"> <ul data-role="listview" class="ulForm">
<li> <li>
<label for="selectTriggerType">${LabelTriggerType}</label> <label for="selectTriggerType" class="selectLabel">${LabelTriggerType}</label>
<select id="selectTriggerType" name="selectTriggerType" onchange="ScheduledTaskPage.refreshTriggerFields(this.value);"> <select id="selectTriggerType" name="selectTriggerType" onchange="ScheduledTaskPage.refreshTriggerFields(this.value);">
<option value="DailyTrigger">${OptionDaily}</option> <option value="DailyTrigger">${OptionDaily}</option>
<option value="WeeklyTrigger">${OptionWeekly}</option> <option value="WeeklyTrigger">${OptionWeekly}</option>
@ -39,7 +44,7 @@
</select> </select>
</li> </li>
<li id="fldDayOfWeek"> <li id="fldDayOfWeek">
<label for="selectDayOfWeek">${LabelDay}</label> <label for="selectDayOfWeek" class="selectLabel">${LabelDay}</label>
<select id="selectDayOfWeek" name="selectDayOfWeek"> <select id="selectDayOfWeek" name="selectDayOfWeek">
<option value="Sunday">${OptionSunday}</option> <option value="Sunday">${OptionSunday}</option>
<option value="Monday">${OptionMonday}</option> <option value="Monday">${OptionMonday}</option>
@ -55,13 +60,13 @@
<input type="time" id="txtTimeOfDay" name="txtTimeOfDay" required="required" /> <input type="time" id="txtTimeOfDay" name="txtTimeOfDay" required="required" />
</li> </li>
<li id="fldSelectSystemEvent"> <li id="fldSelectSystemEvent">
<label for="selectSystemEvent">${LabelEvent}</label> <label for="selectSystemEvent" class="selectLabel">${LabelEvent}</label>
<select id="selectSystemEvent" name="selectSystemEvent"> <select id="selectSystemEvent" name="selectSystemEvent">
<option value="WakeFromSleep">${OptionWakeFromSleep}</option> <option value="WakeFromSleep">${OptionWakeFromSleep}</option>
</select> </select>
</li> </li>
<li id="fldSelectInterval"> <li id="fldSelectInterval">
<label for="selectInterval">${LabelEveryXMinutes}</label> <label for="selectInterval" class="selectLabel">${LabelEveryXMinutes}</label>
<select id="selectInterval"> <select id="selectInterval">
<option value="9000000000">15 minutes</option> <option value="9000000000">15 minutes</option>
<option value="18000000000">30 minutes</option> <option value="18000000000">30 minutes</option>

View file

@ -76,6 +76,9 @@
$('#txtEpisode', popup).val(item.ExtractedEpisodeNumber); $('#txtEpisode', popup).val(item.ExtractedEpisodeNumber);
$('#txtEndingEpisode', popup).val(item.ExtractedEndingEpisodeNumber); $('#txtEndingEpisode', popup).val(item.ExtractedEndingEpisodeNumber);
$('#chkRememberCorrection', popup).val(false);
$('.extractedName', popup).html(item.ExtractedName);
$('#hfResultId', popup).val(item.Id); $('#hfResultId', popup).val(item.Id);
var seriesHtml = allSeries.map(function (s) { var seriesHtml = allSeries.map(function (s) {
@ -146,7 +149,8 @@
SeriesId: $('#selectSeries', form).val(), SeriesId: $('#selectSeries', form).val(),
SeasonNumber: $('#txtSeason', form).val(), SeasonNumber: $('#txtSeason', form).val(),
EpisodeNumber: $('#txtEpisode', form).val(), EpisodeNumber: $('#txtEpisode', form).val(),
EndingEpisodeNumber: $('#txtEndingEpisode', form).val() EndingEpisodeNumber: $('#txtEndingEpisode', form).val(),
RememberCorrection: $('#chkRememberCorrection', form).checked()
}; };
ApiClient.performEpisodeOrganization(resultId, options).then(function () { ApiClient.performEpisodeOrganization(resultId, options).then(function () {

View file

@ -0,0 +1,136 @@
(function ($, document, window) {
var query = {
StartIndex: 0,
Limit: 100000
};
var currentResult;
function reloadList(page) {
Dashboard.showLoadingMsg();
ApiClient.getSmartMatchInfos(query).then(function (infos) {
currentResult = infos;
populateList(page, infos);
Dashboard.hideLoadingMsg();
}, onApiFailure);
}
function populateList(page, result) {
var infos = result.Items;
if (infos.length > 0) {
infos = infos.sort(function (a, b) {
a = a.OrganizerType + " " + a.Name;
b = b.OrganizerType + " " + b.Name;
if (a == b) {
return 0;
}
if (a < b) {
return -1;
}
return 1;
});
}
var html = "";
var currentType;
for (var i = 0, length = infos.length; i < length; i++) {
var info = infos[i];
if (info.OrganizerType != currentType) {
currentType = info.OrganizerType;
if (html.length > 0)
{
html += "</ul>";
}
html += "<h2>" + currentType + "</h2>";
html += '<ul data-role="listview" data-inset="true" data-auto-enhanced="false" data-split-icon="action">';
}
html += "<li data-role='list-divider'><h3 style='font-weight:bold'>" + info.Name + "</h3></li>";
for (var n = 0; n < info.MatchStrings.length; n++) {
html += "<li title='" + info.MatchStrings[n] + "'>";
html += "<a style='padding-top: 0.5em; padding-bottom: 0.5em'>";
html += "<p>" + info.MatchStrings[n] + "</p>";
html += "<a id='btnDeleteMatchEntry" + info.Id + "' class='btnDeleteMatchEntry' href='#' data-id='" + info.Id + "' data-matchstring='" + info.MatchStrings[n] + "' data-icon='delete'>" + Globalize.translate('ButtonDelete') + "</a>";
html += "</a>";
html += "</li>";
}
}
html += "</ul>";
$('.divMatchInfos', page).html(html).trigger('create');
}
function onApiFailure(e) {
Dashboard.hideLoadingMsg();
Dashboard.alert({
title: Globalize.translate('AutoOrganizeError'),
message: Globalize.translate('ErrorOrganizingFileWithErrorCode', e.getResponseHeader("X-Application-Error-Code"))
});
}
$(document).on('pageinit', "#libraryFileOrganizerSmartMatchPage", function () {
var page = this;
$('.divMatchInfos', page).on('click', '.btnDeleteMatchEntry', function () {
var button = this;
var id = button.getAttribute('data-id');
var options = {
MatchString: button.getAttribute('data-matchstring')
};
ApiClient.deleteSmartMatchEntry(id, options).then(function () {
reloadList(page);
}, onApiFailure);
});
}).on('pageshow', "#libraryFileOrganizerSmartMatchPage", function () {
var page = this;
Dashboard.showLoadingMsg();
reloadList(page);
}).on('pagebeforehide', "#libraryFileOrganizerSmartMatchPage", function () {
var page = this;
currentResult = null;
});
})(jQuery, document, window);

View file

@ -1,4 +1,4 @@
define(['https://www.gstatic.com/cv/js/sender/v1/cast_sender.js'], function () { define([], function () {
// Based on https://github.com/googlecast/CastVideos-chrome/blob/master/CastVideos.js // Based on https://github.com/googlecast/CastVideos-chrome/blob/master/CastVideos.js
var currentResolve; var currentResolve;
@ -874,6 +874,10 @@
})); }));
} }
initializeChromecast(); var fileref = document.createElement('script');
fileref.setAttribute("type", "text/javascript");
fileref.onload = initializeChromecast;
fileref.setAttribute("src", "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js");
document.querySelector('head').appendChild(fileref);
}); });

View file

@ -189,7 +189,7 @@
li += '</a>'; li += '</a>';
li += '<a class="btnDeleteXmlAttribute" href="#" data-index="' + index + '"></a>'; li += '<a class="btnDeleteXmlAttribute" href="#" data-icon="delete" data-index="' + index + '"></a>';
li += '</li>'; li += '</li>';
@ -256,7 +256,7 @@
li += '</a>'; li += '</a>';
li += '<a class="btnDeleteProfile" href="#" data-index="' + index + '"></a>'; li += '<a class="btnDeleteProfile" href="#" data-icon="delete" data-index="' + index + '"></a>';
li += '</li>'; li += '</li>';
@ -501,7 +501,7 @@
$('#chkEstimateContentLength', popup).checked(transcodingProfile.EstimateContentLength || false).checkboxradio('refresh'); $('#chkEstimateContentLength', popup).checked(transcodingProfile.EstimateContentLength || false).checkboxradio('refresh');
$('#chkReportByteRangeRequests', popup).checked(transcodingProfile.TranscodeSeekInfo == 'Bytes').checkboxradio('refresh'); $('#chkReportByteRangeRequests', popup).checked(transcodingProfile.TranscodeSeekInfo == 'Bytes').checkboxradio('refresh');
$('.radioTabButton:first', popup).checked(true).checkboxradio('refresh').trigger('change'); $('.radioTabButton:first', popup).trigger('click');
popup.popup('open'); popup.popup('open');
} }
@ -617,7 +617,7 @@
$('#selectContainerProfileType', popup).val(containerProfile.Type || 'Video').trigger('change'); $('#selectContainerProfileType', popup).val(containerProfile.Type || 'Video').trigger('change');
$('#txtContainerProfileContainer', popup).val(containerProfile.Container || ''); $('#txtContainerProfileContainer', popup).val(containerProfile.Container || '');
$('.radioTabButton:first', popup).checked(true).checkboxradio('refresh').trigger('change'); $('.radioTabButton:first', popup).trigger('click');
popup.popup('open'); popup.popup('open');
} }
@ -719,7 +719,7 @@
$('#selectCodecProfileType', popup).val(codecProfile.Type || 'Video').trigger('change'); $('#selectCodecProfileType', popup).val(codecProfile.Type || 'Video').trigger('change');
$('#txtCodecProfileCodec', popup).val(codecProfile.Codec || ''); $('#txtCodecProfileCodec', popup).val(codecProfile.Codec || '');
$('.radioTabButton:first', popup).checked(true).checkboxradio('refresh').trigger('change'); $('.radioTabButton:first', popup).trigger('click');
popup.popup('open'); popup.popup('open');
} }
@ -827,7 +827,7 @@
$('#txtResponseProfileAudioCodec', popup).val(responseProfile.AudioCodec || ''); $('#txtResponseProfileAudioCodec', popup).val(responseProfile.AudioCodec || '');
$('#txtResponseProfileVideoCodec', popup).val(responseProfile.VideoCodec || ''); $('#txtResponseProfileVideoCodec', popup).val(responseProfile.VideoCodec || '');
$('.radioTabButton:first', popup).checked(true).checkboxradio('refresh').trigger('change'); $('.radioTabButton:first', popup).trigger('click');
popup.popup('open'); popup.popup('open');
} }
@ -944,9 +944,12 @@
var page = this; var page = this;
$('.radioTabButton', page).on('change', function () { $('.radioTabButton', page).on('click', function () {
var elem = $('.' + this.value, page); $(this).siblings().removeClass('ui-btn-active');
$(this).addClass('ui-btn-active');
var elem = $('.' + this.getAttribute('data-value'), page);
elem.siblings('.tabContent').hide(); elem.siblings('.tabContent').hide();
elem.show(); elem.show();
@ -1070,8 +1073,7 @@
var page = this; var page = this;
$('.radioTabButton', page).checked(false).checkboxradio('refresh'); $('#radioInfo', page).trigger('click');
$('#radioInfo', page).checked(true).checkboxradio('refresh').trigger('change');
loadProfile(page); loadProfile(page);
}); });

View file

@ -6,78 +6,76 @@
ApiClient.getJSON(ApiClient.getUrl("Dlna/ProfileInfos")).then(function (result) { ApiClient.getJSON(ApiClient.getUrl("Dlna/ProfileInfos")).then(function (result) {
renderProfiles(page, result); renderUserProfiles(page, result);
renderSystemProfiles(page, result);
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
} }
function renderProfiles(page, profiles) {
renderUserProfiles(page, profiles);
renderSystemProfiles(page, profiles);
}
function renderUserProfiles(page, profiles) { function renderUserProfiles(page, profiles) {
profiles = profiles.filter(function (p) { renderProfiles(page, page.querySelector('.customProfiles'), profiles.filter(function (p) {
return p.Type == 'User'; return p.Type == 'User';
}); }));
var html = '';
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
for (var i = 0, length = profiles.length; i < length; i++) {
var profile = profiles[i];
html += '<li>';
html += '<a href="dlnaprofile.html?id=' + profile.Id + '">';
html += profile.Name;
html += '</a>';
html += '<a href="#" data-icon="delete" class="btnDeleteProfile" data-profileid="' + profile.Id + '">' + Globalize.translate('Delete') + '</a>';
html += '</li>';
}
html += '</ul>';
var elem = $('.customProfiles', page).html(html).trigger('create');
$('.btnDeleteProfile', elem).on('click', function () {
var id = this.getAttribute('data-profileid');
deleteProfile(page, id);
});
} }
function renderSystemProfiles(page, profiles) { function renderSystemProfiles(page, profiles) {
profiles = profiles.filter(function (p) { renderProfiles(page, page.querySelector('.systemProfiles'), profiles.filter(function (p) {
return p.Type == 'System'; return p.Type == 'System';
}); }));
}
function renderProfiles(page, element, profiles) {
require(['paper-fab', 'paper-item-body', 'paper-icon-item'], function () {
var html = ''; var html = '';
html += '<ul data-role="listview" data-inset="true">'; if (profiles.length) {
html += '<div class="paperList">';
}
for (var i = 0, length = profiles.length; i < length; i++) { for (var i = 0, length = profiles.length; i < length; i++) {
var profile = profiles[i]; var profile = profiles[i];
html += '<li>'; html += '<paper-icon-item>';
html += '<a href="dlnaprofile.html?id=' + profile.Id + '">';
html += profile.Name; html += "<a item-icon class='clearLink' href='dlnaprofile.html?id=" + profile.Id + "'>";
html += '</a>'; html += '<paper-fab mini icon="dvr" class="blue"></paper-fab>';
html += '</li>'; html += "</a>";
html += '<paper-item-body two-line>';
html += "<a class='clearLink' href='dlnaprofile.html?id=" + profile.Id + "'>";
html += "<div>" + profile.Name + "</div>";
//html += "<div secondary>" + task.Description + "</div>";
html += "</a>";
html += '</paper-item-body>';
if (profile.Type == 'User') {
html += '<paper-icon-button icon="delete" class="btnDeleteProfile" data-profileid="' + profile.Id + '" title="' + Globalize.translate('ButtonDelete') + '"></paper-icon-button>';
} }
html += '</ul>'; html += '</paper-icon-item>';
}
$('.systemProfiles', page).html(html).trigger('create'); if (profiles.length) {
html += '</div>';
}
element.innerHTML = html;
$('.btnDeleteProfile', element).on('click', function () {
var id = this.getAttribute('data-profileid');
deleteProfile(page, id);
});
});
} }
function deleteProfile(page, id) { function deleteProfile(page, id) {

View file

@ -596,7 +596,7 @@
html += '</li>'; html += '</li>';
} }
elem.html(html).listview('refresh'); elem.html(html);
$('.btnDeletePerson', elem).on('click', function () { $('.btnDeletePerson', elem).on('click', function () {
@ -716,7 +716,7 @@
for (var i = 0; i < items.length; i++) { for (var i = 0; i < items.length; i++) {
html += '<li data-mini="true"><a class="data">' + items[i] + '</a><a href="#" onclick="EditItemMetadataPage.removeElementFromListview(this)" class="btnRemoveFromEditorList"></a></li>'; html += '<li data-mini="true"><a class="data">' + items[i] + '</a><a href="#" onclick="EditItemMetadataPage.removeElementFromListview(this)" class="btnRemoveFromEditorList"></a></li>';
} }
list.html(html).listview('refresh'); list.html(html);
} }
function editableListViewValues(list) { function editableListViewValues(list) {
@ -1008,7 +1008,6 @@
self.removeElementFromListview = function (source) { self.removeElementFromListview = function (source) {
var list = $(source).parents('ul[data-role="listview"]'); var list = $(source).parents('ul[data-role="listview"]');
$(source).parent().remove(); $(source).parent().remove();
list.listview('refresh');
}; };
self.onRefreshFormSubmit = function () { self.onRefreshFormSubmit = function () {

View file

@ -10,23 +10,7 @@
var mediaElement; var mediaElement;
var self = this; var self = this;
function hideStatusBar() {
if (options.type == 'video' && window.StatusBar) {
//StatusBar.backgroundColorByName("black");
//StatusBar.overlaysWebView(true);
StatusBar.hide();
}
}
function showStatusBar() {
if (options.type == 'video' && window.StatusBar) {
StatusBar.show();
//StatusBar.overlaysWebView(false);
}
}
function onEnded() { function onEnded() {
showStatusBar();
Events.trigger(self, 'ended'); Events.trigger(self, 'ended');
} }
@ -87,7 +71,6 @@
var errorCode = elem.error ? elem.error.code : ''; var errorCode = elem.error ? elem.error.code : '';
console.log('Media element error code: ' + errorCode); console.log('Media element error code: ' + errorCode);
showStatusBar();
Events.trigger(self, 'error'); Events.trigger(self, 'error');
} }
@ -130,8 +113,6 @@
function onOneVideoPlaying(e) { function onOneVideoPlaying(e) {
hideStatusBar();
var element = e.target; var element = e.target;
element.removeEventListener('playing', onOneVideoPlaying); element.removeEventListener('playing', onOneVideoPlaying);
@ -173,7 +154,7 @@
var requiresControls = !MediaPlayer.canAutoPlayAudio(); var requiresControls = !MediaPlayer.canAutoPlayAudio();
if (requiresControls) { if (requiresControls) {
html += '<div class="mediaPlayerAudioContainer" style="position: fixed;top: 40%;text-align: center;left: 0;right: 0;"><div class="mediaPlayerAudioContainerInner">';; html += '<div class="mediaPlayerAudioContainer" style="position: fixed;top: 40%;text-align: center;left: 0;right: 0;z-index:999999;"><div class="mediaPlayerAudioContainerInner">';;
} else { } else {
html += '<div class="mediaPlayerAudioContainer" style="display:none;padding: 1em;background: #222;"><div class="mediaPlayerAudioContainerInner">';; html += '<div class="mediaPlayerAudioContainer" style="display:none;padding: 1em;background: #222;"><div class="mediaPlayerAudioContainerInner">';;
} }
@ -507,8 +488,6 @@
$(elem).remove(); $(elem).remove();
} }
} }
showStatusBar();
}; };
self.supportsTextTracks = function () { self.supportsTextTracks = function () {

View file

@ -852,11 +852,19 @@
require(['hammer'], function (Hammer) { require(['hammer'], function (Hammer) {
var hammertime = new Hammer(element); var manager = new Hammer.Manager(element);
var press = new Hammer.Press({
time: 500
});
manager.add(press);
//var hammertime = new Hammer(element);
element.classList.add('hasTapHold'); element.classList.add('hasTapHold');
hammertime.on('press', onTapHold); manager.on('press', onTapHold);
hammertime.on('pressup', onTapHoldUp); manager.on('pressup', onTapHoldUp);
}); });
showTapHoldHelp(element); showTapHoldHelp(element);

View file

@ -39,47 +39,49 @@
var html = config.PathSubstitutions.map(function (map) { var html = config.PathSubstitutions.map(function (map) {
var mapHtml = '<tr>'; var mapHtml = '';
mapHtml += '<paper-icon-item>';
mapHtml += '<td style="vertical-align:middle;">'; mapHtml += '<paper-fab mini icon="folder" class="blue" item-icon></paper-fab>';
mapHtml += map.From;
mapHtml += '</td>';
mapHtml += '<td style="vertical-align:middle;">'; mapHtml += '<paper-item-body three-line>';
mapHtml += map.To;
mapHtml += '</td>'; mapHtml += "<div>" + map.From + "</div>";
mapHtml += "<div secondary><b>" + Globalize.translate('HeaderTo') + "</b></div>";
mapHtml += "<div secondary>" + map.To + "</div>";
mapHtml += '</paper-item-body>';
mapHtml += '<td>';
mapHtml += '<paper-icon-button data-index="' + index + '" icon="delete" class="btnDeletePath"></paper-icon-button>'; mapHtml += '<paper-icon-button data-index="' + index + '" icon="delete" class="btnDeletePath"></paper-icon-button>';
mapHtml += '</td>';
mapHtml += '</tr>'; mapHtml += '</paper-icon-item>';
index++; index++;
return mapHtml; return mapHtml;
});
var elem = $('.tbodyPathSubstitutions', page).html(html.join('')).parents('table').table('refresh').trigger('create'); }).join('');
if (config.PathSubstitutions.length) {
html = '<div class="paperList">' + html + '</div>';
}
var elem = $('.pathSubstitutions', page).html(html);
$('.btnDeletePath', elem).on('click', function () { $('.btnDeletePath', elem).on('click', function () {
remove(page, parseInt(this.getAttribute('data-index'))); remove(page, parseInt(this.getAttribute('data-index')));
}); });
if (config.PathSubstitutions.length) {
$('#tblPaths', page).show();
} else {
$('#tblPaths', page).hide();
}
} }
function loadPage(page, config) { function loadPage(page, config) {
currentConfig = config; currentConfig = config;
require(['paper-fab', 'paper-item-body', 'paper-icon-item'], function () {
reloadPathMappings(page, config); reloadPathMappings(page, config);
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
});
} }
function reload(page) { function reload(page) {

View file

@ -1,8 +1,11 @@
(function () { (function () {
$(document).on('pageshow', "#logPage", function () { $(document).on('pagebeforeshow', "#logPage", function () {
var page = this; var page = this;
Dashboard.showLoadingMsg();
require(['paper-fab', 'paper-item-body', 'paper-icon-item'], function () {
var apiClient = ApiClient; var apiClient = ApiClient;
@ -10,7 +13,7 @@
var html = ''; var html = '';
html += '<ul data-role="listview" data-inset="true">'; html += '<div class="paperList">';
html += logs.map(function (log) { html += logs.map(function (log) {
@ -20,11 +23,17 @@
logUrl += "&api_key=" + apiClient.accessToken(); logUrl += "&api_key=" + apiClient.accessToken();
var logHtml = '<li><a href="' + logUrl + '" target="_blank">'; var logHtml = '';
logHtml += '<paper-icon-item>';
logHtml += '<h3>'; logHtml += '<a item-icon class="clearLink" href="' + logUrl + '" target="_blank">';
logHtml += log.Name; logHtml += '<paper-fab mini icon="schedule" class="blue" item-icon></paper-fab>';
logHtml += '</h3>'; logHtml += "</a>";
logHtml += '<paper-item-body two-line>';
logHtml += '<a class="clearLink" href="' + logUrl + '" target="_blank">';
logHtml += "<div>" + log.Name + "</div>";
var date = parseISO8601Date(log.DateModified, { toLocal: true }); var date = parseISO8601Date(log.DateModified, { toLocal: true });
@ -32,20 +41,25 @@
text += ' ' + LibraryBrowser.getDisplayTime(date); text += ' ' + LibraryBrowser.getDisplayTime(date);
logHtml += '<p>' + text + '</p>'; logHtml += '<div secondary>' + text + '</div>';
logHtml += '</li>'; logHtml += "</a>";
logHtml += '</paper-item-body>';
logHtml += '</paper-icon-item>';
return logHtml; return logHtml;
}) })
.join(''); .join('');
html += '</ul>'; html += '</div>';
$('.serverLogs', page).html(html).trigger('create'); $('.serverLogs', page).html(html).trigger('create');
Dashboard.hideLoadingMsg();
}); });
}); });
});
})(); })();

View file

@ -206,8 +206,6 @@
elemToMove.parentNode.removeChild(elemToMove); elemToMove.parentNode.removeChild(elemToMove);
$(elemToMove).insertAfter(insertAfter); $(elemToMove).insertAfter(insertAfter);
$('.imageFetcherGroup', page).controlgroup('destroy').controlgroup();
}); });
$('.btnUp', elem).on('click', function () { $('.btnUp', elem).on('click', function () {
@ -220,8 +218,6 @@
elemToMove.parentNode.removeChild(elemToMove); elemToMove.parentNode.removeChild(elemToMove);
$(elemToMove).insertBefore(insertBefore); $(elemToMove).insertBefore(insertBefore);
$('.imageFetcherGroup', page).controlgroup('destroy').controlgroup();
}); });
} }
@ -330,8 +326,6 @@
elemToMove.parentNode.removeChild(elemToMove); elemToMove.parentNode.removeChild(elemToMove);
$(elemToMove).insertAfter(insertAfter); $(elemToMove).insertAfter(insertAfter);
$('.metadataFetcherGroup', page).controlgroup('destroy').controlgroup();
}); });
$('.btnUp', elem).on('click', function () { $('.btnUp', elem).on('click', function () {
@ -344,8 +338,6 @@
elemToMove.parentNode.removeChild(elemToMove); elemToMove.parentNode.removeChild(elemToMove);
$(elemToMove).insertBefore(insertBefore); $(elemToMove).insertBefore(insertBefore);
$('.metadataFetcherGroup', page).controlgroup('destroy').controlgroup();
}); });
} }
@ -551,8 +543,6 @@
} }
}); });
ul.listview('destroy').listview({});
}); });
$('#selectItemType', page).on('change', function () { $('#selectItemType', page).on('change', function () {

View file

@ -129,10 +129,10 @@
function bindEvents(elem) { function bindEvents(elem) {
currentTimeElement = $('.nowPlayingBarCurrentTime', elem); currentTimeElement = elem.querySelector('.nowPlayingBarCurrentTime');
nowPlayingImageElement = elem.querySelector('.nowPlayingImage'); nowPlayingImageElement = elem.querySelector('.nowPlayingImage');
nowPlayingTextElement = $('.nowPlayingBarText', elem); nowPlayingTextElement = elem.querySelector('.nowPlayingBarText');
nowPlayingUserData = $('.nowPlayingBarUserDataButtons', elem); nowPlayingUserData = elem.querySelector('.nowPlayingBarUserDataButtons');
unmuteButton = $('.unmuteButton', elem).on('click', function () { unmuteButton = $('.unmuteButton', elem).on('click', function () {
@ -385,7 +385,7 @@
} }
currentTimeElement.html(timeText); currentTimeElement.innerHTML = timeText;
updateNowPlayingInfo(state); updateNowPlayingInfo(state);
} }
@ -478,16 +478,16 @@
var nameHtml = MediaController.getNowPlayingNameHtml(state.NowPlayingItem) || ''; var nameHtml = MediaController.getNowPlayingNameHtml(state.NowPlayingItem) || '';
if (nameHtml.indexOf('<br/>') != -1) { if (nameHtml.indexOf('<br/>') != -1) {
nowPlayingTextElement.addClass('nowPlayingDoubleText'); nowPlayingTextElement.classList.add('nowPlayingDoubleText');
} else { } else {
nowPlayingTextElement.removeClass('nowPlayingDoubleText'); nowPlayingTextElement.classList.remove('nowPlayingDoubleText');
} }
if (state.NowPlayingItem.Id) { if (state.NowPlayingItem.Id) {
nameHtml = '<a style="color:inherit;text-decoration:none;" href="' + LibraryBrowser.getHref(state.NowPlayingItem) + '">' + nameHtml + '</a>'; nameHtml = '<a style="color:inherit;text-decoration:none;" href="' + LibraryBrowser.getHref(state.NowPlayingItem) + '">' + nameHtml + '</a>';
} }
nowPlayingTextElement.html(nameHtml); nowPlayingTextElement.innerHTML = nameHtml;
var url; var url;
var imgHeight = 80; var imgHeight = 80;
@ -540,10 +540,10 @@
if (nowPlayingItem.Id) { if (nowPlayingItem.Id) {
ApiClient.getItem(Dashboard.getCurrentUserId(), nowPlayingItem.Id).then(function (item) { ApiClient.getItem(Dashboard.getCurrentUserId(), nowPlayingItem.Id).then(function (item) {
nowPlayingUserData.html(LibraryBrowser.getUserDataIconsHtml(item, false)); nowPlayingUserData.innerHTML = LibraryBrowser.getUserDataIconsHtml(item, false);
}); });
} else { } else {
nowPlayingUserData.html(''); nowPlayingUserData.innerHTML = '';
} }
} }

View file

@ -134,10 +134,16 @@
if (showNoPluginsMessage) { if (showNoPluginsMessage) {
html += '<div style="padding:5px;">'; html += '<div style="padding:5px;">';
if (AppInfo.enableAppStorePolicy) {
html += '<p>' + Globalize.translate('MessageNoPluginsDueToAppStore') + '</p>';
} else {
html += '<p>' + Globalize.translate('MessageNoPluginsInstalled') + '</p>'; html += '<p>' + Globalize.translate('MessageNoPluginsInstalled') + '</p>';
html += '<p><a href="plugincatalog.html">'; html += '<p><a href="plugincatalog.html">';
html += Globalize.translate('BrowsePluginCatalogMessage'); html += Globalize.translate('BrowsePluginCatalogMessage');
html += '</a></p>'; html += '</a></p>';
}
html += '</div>'; html += '</div>';
} }

View file

@ -15,7 +15,7 @@
var html = ''; var html = '';
// style="margin: -.2em -.8em;" // style="margin: -.2em -.8em;"
html += '<div data-role="controlgroup">'; html += '<div>';
var index = 0; var index = 0;
var idPrefix = 'chk' + selector.substring(1); var idPrefix = 'chk' + selector.substring(1);

View file

@ -18,37 +18,39 @@ var ScheduledTaskPage = {
loadScheduledTask: function (task) { loadScheduledTask: function (task) {
var page = $.mobile.activePage; var page = $($.mobile.activePage)[0];
$('.taskName', page).html(task.Name); $('.taskName', page).html(task.Name);
$('#pTaskDescription', page).html(task.Description); $('#pTaskDescription', page).html(task.Description);
ScheduledTaskPage.loadTaskTriggers(task); require(['paper-fab', 'paper-item-body', 'paper-icon-item'], function () {
ScheduledTaskPage.loadTaskTriggers(page, task);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}, },
loadTaskTriggers: function (task) { loadTaskTriggers: function (context, task) {
var html = ''; var html = '';
html += '<li data-role="list-divider"><h3>' + Globalize.translate('HeaderTaskTriggers') + '</h3></li>'; html += '<div class="paperList">';
for (var i = 0, length = task.Triggers.length; i < length; i++) { for (var i = 0, length = task.Triggers.length; i < length; i++) {
var trigger = task.Triggers[i]; var trigger = task.Triggers[i];
html += '<li>'; html += '<paper-icon-item>';
html += '<a href="#">'; html += '<paper-fab mini icon="schedule" class="blue" item-icon></paper-fab>';
html += '<h3>'; html += '<paper-item-body two-line>';
html += ScheduledTaskPage.getTriggerFriendlyName(trigger);
html += '</h3>'; html += "<div>" + ScheduledTaskPage.getTriggerFriendlyName(trigger) + "</div>";
if (trigger.MaxRuntimeMs) { if (trigger.MaxRuntimeMs) {
html += '<p>'; html += '<div secondary>';
var hours = trigger.MaxRuntimeMs / 3600000; var hours = trigger.MaxRuntimeMs / 3600000;
@ -57,19 +59,19 @@ var ScheduledTaskPage = {
} else { } else {
html += Globalize.translate('ValueTimeLimitMultiHour', hours); html += Globalize.translate('ValueTimeLimitMultiHour', hours);
} }
html += '</p>'; html += '</div>';
} }
html += '</a>'; html += '</paper-item-body>';
html += '<a href="#" onclick="ScheduledTaskPage.confirmDeleteTrigger(' + i + ');">'; html += '<paper-icon-button icon="delete" title="' + Globalize.translate('ButtonDelete') + '" onclick="ScheduledTaskPage.confirmDeleteTrigger(' + i + ');"></paper-icon-button>';
html += Globalize.translate('Delete');
html += '</a>';
html += '</li>'; html += '</paper-icon-item>';
} }
$('#ulTaskTriggers', $.mobile.activePage).html(html).listview('refresh'); html += '</div>';
context.querySelector('.taskTriggers').innerHTML = html;
}, },
getTriggerFriendlyName: function (trigger) { getTriggerFriendlyName: function (trigger) {

View file

@ -1639,7 +1639,15 @@ var AppInfo = {};
function initializeApiClient(apiClient) { function initializeApiClient(apiClient) {
apiClient.enableAppStorePolicy = AppInfo.enableAppStorePolicy; if (AppInfo.enableAppStorePolicy) {
apiClient.getAvailablePlugins = function() {
return Promise.resolve([]);
};
apiClient.getInstalledPlugins = function () {
return Promise.resolve([]);
};
}
apiClient.getDefaultImageQuality = Dashboard.getDefaultImageQuality; apiClient.getDefaultImageQuality = Dashboard.getDefaultImageQuality;
apiClient.normalizeImageOptions = Dashboard.normalizeImageOptions; apiClient.normalizeImageOptions = Dashboard.normalizeImageOptions;
@ -1958,26 +1966,29 @@ var AppInfo = {};
define("paper-icon-item", ["html!" + bowerPath + "/paper-item/paper-icon-item.html"]); define("paper-icon-item", ["html!" + bowerPath + "/paper-item/paper-icon-item.html"]);
define("paper-item-body", ["html!" + bowerPath + "/paper-item/paper-item-body.html"]); define("paper-item-body", ["html!" + bowerPath + "/paper-item/paper-item-body.html"]);
define("paper-collapse-item", ["html!" + bowerPath + "/paper-collapse-item/paper-collapse-item.html"]);
define("jstree", [bowerPath + "/jstree/dist/jstree.min", "css!thirdparty/jstree/themes/default/style.min.css"]); define("jstree", [bowerPath + "/jstree/dist/jstree.min", "css!thirdparty/jstree/themes/default/style.min.css"]);
define("jqmicons", ['css!thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.icons.css']); define("jqmbase", ['css!thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.theme.css']);
define("jqmtable", ["thirdparty/jquerymobile-1.4.5/jqm.table", 'css!thirdparty/jquerymobile-1.4.5/jqm.table.css']); define("jqmicons", ['jqmbase', 'css!thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.icons.css']);
define("jqmtable", ['jqmbase', "thirdparty/jquerymobile-1.4.5/jqm.table", 'css!thirdparty/jquerymobile-1.4.5/jqm.table.css']);
define("jqmwidget", ["thirdparty/jquerymobile-1.4.5/jqm.widget"]); define("jqmwidget", ['jqmbase', "thirdparty/jquerymobile-1.4.5/jqm.widget"]);
define("jqmslider", ["thirdparty/jquerymobile-1.4.5/jqm.slider", 'css!thirdparty/jquerymobile-1.4.5/jqm.slider.css']); define("jqmslider", ['jqmbase', "thirdparty/jquerymobile-1.4.5/jqm.slider", 'css!thirdparty/jquerymobile-1.4.5/jqm.slider.css']);
define("jqmpopup", ["thirdparty/jquerymobile-1.4.5/jqm.popup", 'css!thirdparty/jquerymobile-1.4.5/jqm.popup.css']); define("jqmpopup", ['jqmbase', "thirdparty/jquerymobile-1.4.5/jqm.popup", 'css!thirdparty/jquerymobile-1.4.5/jqm.popup.css']);
define("jqmlistview", ["thirdparty/jquerymobile-1.4.5/jqm.listview", 'css!thirdparty/jquerymobile-1.4.5/jqm.listview.css']); define("jqmlistview", ['jqmbase', 'css!thirdparty/jquerymobile-1.4.5/jqm.listview.css']);
define("jqmcontrolgroup", ["thirdparty/jquerymobile-1.4.5/jqm.controlgroup", 'css!thirdparty/jquerymobile-1.4.5/jqm.controlgroup.css']); define("jqmcontrolgroup", ['jqmbase', 'css!thirdparty/jquerymobile-1.4.5/jqm.controlgroup.css']);
define("jqmcollapsible", ["jqmicons", "thirdparty/jquerymobile-1.4.5/jqm.collapsible", 'css!thirdparty/jquerymobile-1.4.5/jqm.collapsible.css']); define("jqmcollapsible", ['jqmbase', "jqmicons", "thirdparty/jquerymobile-1.4.5/jqm.collapsible", 'css!thirdparty/jquerymobile-1.4.5/jqm.collapsible.css']);
define("jqmcheckbox", ["jqmicons", "thirdparty/jquerymobile-1.4.5/jqm.checkbox", 'css!thirdparty/jquerymobile-1.4.5/jqm.checkbox.css']); define("jqmcheckbox", ['jqmbase', "jqmicons", "thirdparty/jquerymobile-1.4.5/jqm.checkbox", 'css!thirdparty/jquerymobile-1.4.5/jqm.checkbox.css']);
define("jqmpanel", ["thirdparty/jquerymobile-1.4.5/jqm.panel", 'css!thirdparty/jquerymobile-1.4.5/jqm.panel.css']); define("jqmpanel", ['jqmbase', "thirdparty/jquerymobile-1.4.5/jqm.panel", 'css!thirdparty/jquerymobile-1.4.5/jqm.panel.css']);
define("iron-icon-set", ["html!" + bowerPath + "/iron-icon/iron-icon.html", "html!" + bowerPath + "/iron-iconset-svg/iron-iconset-svg.html"]); define("iron-icon-set", ["html!" + bowerPath + "/iron-icon/iron-icon.html", "html!" + bowerPath + "/iron-iconset-svg/iron-iconset-svg.html"]);
define("slideshow", [embyWebComponentsBowerPath + "/slideshow/slideshow"], returnFirstDependency); define("slideshow", [embyWebComponentsBowerPath + "/slideshow/slideshow"], returnFirstDependency);
@ -2037,6 +2048,21 @@ var AppInfo = {};
define("connectionManager", [], function () { define("connectionManager", [], function () {
return ConnectionManager; return ConnectionManager;
}); });
define("globalize", [], function () {
return Globalize;
});
define('dialogText', [], getDialogText());
}
function getDialogText() {
return function () {
return {
buttonOk: 'ButtonOk',
buttonCancel: 'ButtonCancel'
};
};
} }
function initRequireWithBrowser(browser) { function initRequireWithBrowser(browser) {
@ -2223,12 +2249,7 @@ var AppInfo = {};
depends = depends || []; depends = depends || [];
if (newHtml.indexOf('type-interior') != -1) { if (newHtml.indexOf('type-interior') != -1) {
depends.push('jqmpopup'); addLegacyDependencies(depends, window.location.href);
depends.push('jqmlistview');
depends.push('jqmcollapsible');
depends.push('jqmcontrolgroup');
depends.push('jqmcheckbox');
depends.push('scripts/notifications');
} }
require(depends, function () { require(depends, function () {
@ -2493,6 +2514,21 @@ var AppInfo = {};
})(); })();
function addLegacyDependencies(depends, url) {
var isPluginpage = url.toLowerCase().indexOf('/configurationpage?') != -1;
if (isPluginpage) {
depends.push('jqmpopup');
depends.push('jqmcollapsible');
}
depends.push('jqmcontrolgroup');
depends.push('jqmlistview');
depends.push('jqmcheckbox');
depends.push('scripts/notifications');
}
function pageClassOn(eventName, className, fn) { function pageClassOn(eventName, className, fn) {
document.addEventListener(eventName, function (e) { document.addEventListener(eventName, function (e) {

View file

@ -78,7 +78,7 @@
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
require(['paper-checkbox', 'paper-input'], function () { require(['paper-checkbox', 'paper-input', 'jqmcollapsible'], function () {
renderFormInternal(options); renderFormInternal(options);
resolve(); resolve();
}); });
@ -183,7 +183,7 @@
//html += '</div>'; //html += '</div>';
//html += '</div>'; //html += '</div>';
$(elem).html(html); $(elem).html(html).trigger('create');
$('#selectSyncTarget', elem).on('change', function () { $('#selectSyncTarget', elem).on('change', function () {

View file

@ -1,4 +1,8 @@
{ {
"HeaderTaskTriggers": "Task Triggers",
"TabSmartMatches": "Smart Matches",
"LabelOrganizeSmartMatchOption": "In the future, organize all files into the selected series if the name contains",
"TabSmartMatchInfo": "Manage your smart matches that were added using the Auto-Organize correction dialog",
"LabelExit": "\u062e\u0631\u0648\u062c", "LabelExit": "\u062e\u0631\u0648\u062c",
"LabelVisitCommunity": "\u0632\u064a\u0627\u0631\u0629 \u0627\u0644\u0645\u062c\u062a\u0645\u0639", "LabelVisitCommunity": "\u0632\u064a\u0627\u0631\u0629 \u0627\u0644\u0645\u062c\u062a\u0645\u0639",
"LabelGithub": "\u062c\u064a\u062a \u0647\u0628", "LabelGithub": "\u062c\u064a\u062a \u0647\u0628",
@ -1528,5 +1532,5 @@
"HeaderNewRecording": "New Recording", "HeaderNewRecording": "New Recording",
"ButtonAdvanced": "Advanced", "ButtonAdvanced": "Advanced",
"LabelCodecIntrosPath": "Codec intros path:", "LabelCodecIntrosPath": "Codec intros path:",
"LabelCodecIntrosPathHelp": "A folder containing video files. If an intro video file name matches the video codec, audio codec, or audio profile, then it will be played prior to the main feature." "LabelCodecIntrosPathHelp": "A folder containing video files. If an intro video file name matches the video codec, audio codec, audio profile, or a tag, then it will be played prior to the main feature."
} }

View file

@ -1,4 +1,8 @@
{ {
"HeaderTaskTriggers": "Task Triggers",
"TabSmartMatches": "Smart Matches",
"LabelOrganizeSmartMatchOption": "In the future, organize all files into the selected series if the name contains",
"TabSmartMatchInfo": "Manage your smart matches that were added using the Auto-Organize correction dialog",
"LabelExit": "\u0418\u0437\u0445\u043e\u0434", "LabelExit": "\u0418\u0437\u0445\u043e\u0434",
"LabelVisitCommunity": "\u041f\u043e\u0441\u0435\u0442\u0438 \u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u0442\u043e", "LabelVisitCommunity": "\u041f\u043e\u0441\u0435\u0442\u0438 \u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u0442\u043e",
"LabelGithub": "Github", "LabelGithub": "Github",
@ -1528,5 +1532,5 @@
"HeaderNewRecording": "New Recording", "HeaderNewRecording": "New Recording",
"ButtonAdvanced": "Advanced", "ButtonAdvanced": "Advanced",
"LabelCodecIntrosPath": "Codec intros path:", "LabelCodecIntrosPath": "Codec intros path:",
"LabelCodecIntrosPathHelp": "A folder containing video files. If an intro video file name matches the video codec, audio codec, or audio profile, then it will be played prior to the main feature." "LabelCodecIntrosPathHelp": "A folder containing video files. If an intro video file name matches the video codec, audio codec, audio profile, or a tag, then it will be played prior to the main feature."
} }

View file

@ -1,4 +1,8 @@
{ {
"HeaderTaskTriggers": "Task Triggers",
"TabSmartMatches": "Smart Matches",
"LabelOrganizeSmartMatchOption": "In the future, organize all files into the selected series if the name contains",
"TabSmartMatchInfo": "Manage your smart matches that were added using the Auto-Organize correction dialog",
"LabelExit": "Sortir", "LabelExit": "Sortir",
"LabelVisitCommunity": "Visita la comunitat", "LabelVisitCommunity": "Visita la comunitat",
"LabelGithub": "Github", "LabelGithub": "Github",
@ -1528,5 +1532,5 @@
"HeaderNewRecording": "New Recording", "HeaderNewRecording": "New Recording",
"ButtonAdvanced": "Advanced", "ButtonAdvanced": "Advanced",
"LabelCodecIntrosPath": "Codec intros path:", "LabelCodecIntrosPath": "Codec intros path:",
"LabelCodecIntrosPathHelp": "A folder containing video files. If an intro video file name matches the video codec, audio codec, or audio profile, then it will be played prior to the main feature." "LabelCodecIntrosPathHelp": "A folder containing video files. If an intro video file name matches the video codec, audio codec, audio profile, or a tag, then it will be played prior to the main feature."
} }

View file

@ -1,4 +1,8 @@
{ {
"HeaderTaskTriggers": "Spou\u0161t\u011b\u010de \u00faloh",
"TabSmartMatches": "Smart Matches",
"LabelOrganizeSmartMatchOption": "In the future, organize all files into the selected series if the name contains",
"TabSmartMatchInfo": "Manage your smart matches that were added using the Auto-Organize correction dialog",
"LabelExit": "Zav\u0159\u00edt", "LabelExit": "Zav\u0159\u00edt",
"LabelVisitCommunity": "Nav\u0161t\u00edvit komunitu", "LabelVisitCommunity": "Nav\u0161t\u00edvit komunitu",
"LabelGithub": "Github", "LabelGithub": "Github",
@ -1528,5 +1532,5 @@
"HeaderNewRecording": "New Recording", "HeaderNewRecording": "New Recording",
"ButtonAdvanced": "Advanced", "ButtonAdvanced": "Advanced",
"LabelCodecIntrosPath": "Codec intros path:", "LabelCodecIntrosPath": "Codec intros path:",
"LabelCodecIntrosPathHelp": "A folder containing video files. If an intro video file name matches the video codec, audio codec, or audio profile, then it will be played prior to the main feature." "LabelCodecIntrosPathHelp": "A folder containing video files. If an intro video file name matches the video codec, audio codec, audio profile, or a tag, then it will be played prior to the main feature."
} }

View file

@ -1,4 +1,8 @@
{ {
"HeaderTaskTriggers": "Task Triggers",
"TabSmartMatches": "Smart Matches",
"LabelOrganizeSmartMatchOption": "In the future, organize all files into the selected series if the name contains",
"TabSmartMatchInfo": "Manage your smart matches that were added using the Auto-Organize correction dialog",
"LabelExit": "Afslut", "LabelExit": "Afslut",
"LabelVisitCommunity": "Bes\u00f8g F\u00e6lleskab", "LabelVisitCommunity": "Bes\u00f8g F\u00e6lleskab",
"LabelGithub": "Github", "LabelGithub": "Github",
@ -1528,5 +1532,5 @@
"HeaderNewRecording": "New Recording", "HeaderNewRecording": "New Recording",
"ButtonAdvanced": "Advanced", "ButtonAdvanced": "Advanced",
"LabelCodecIntrosPath": "Codec intros path:", "LabelCodecIntrosPath": "Codec intros path:",
"LabelCodecIntrosPathHelp": "A folder containing video files. If an intro video file name matches the video codec, audio codec, or audio profile, then it will be played prior to the main feature." "LabelCodecIntrosPathHelp": "A folder containing video files. If an intro video file name matches the video codec, audio codec, audio profile, or a tag, then it will be played prior to the main feature."
} }

View file

@ -1,4 +1,8 @@
{ {
"HeaderTaskTriggers": "Aufgabenausl\u00f6ser",
"TabSmartMatches": "Smart Matches",
"LabelOrganizeSmartMatchOption": "Organisiere alle zuk\u00fcnftigen Dateien in die ausgew\u00e4hlten Serien deren Name enth\u00e4lt",
"TabSmartMatchInfo": "Verwalten Sie Ihre Smart Matches die wir w\u00e4hrend im Berichtigungsdialog der Autoorganisation hinzugef\u00fcgt haben",
"LabelExit": "Beenden", "LabelExit": "Beenden",
"LabelVisitCommunity": "Besuche die Community", "LabelVisitCommunity": "Besuche die Community",
"LabelGithub": "Github", "LabelGithub": "Github",
@ -1527,6 +1531,6 @@
"LabelDisplayName": "Anzeige Name:", "LabelDisplayName": "Anzeige Name:",
"HeaderNewRecording": "Neue Aufnahme", "HeaderNewRecording": "Neue Aufnahme",
"ButtonAdvanced": "Erweitert", "ButtonAdvanced": "Erweitert",
"LabelCodecIntrosPath": "Codec intros path:", "LabelCodecIntrosPath": "Codec Intros Verzeichnis:",
"LabelCodecIntrosPathHelp": "A folder containing video files. If an intro video file name matches the video codec, audio codec, or audio profile, then it will be played prior to the main feature." "LabelCodecIntrosPathHelp": "Ein Verzeichnis welches Video Dateien beinhaltet. Wenn ein Intro Video einem Video codec, audio codec, audio profil oder einem Tag zugeordnet werden kann, so wird es vor dem Hauptfilm gezeigt."
} }

Some files were not shown because too many files have changed in this diff Show more