1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #1694 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-04-30 00:10:33 -04:00
commit 3bb2bdeb71
50 changed files with 297 additions and 112 deletions

View file

@ -16,12 +16,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.1.53",
"_release": "1.1.53",
"version": "1.1.54",
"_release": "1.1.54",
"_resolution": {
"type": "version",
"tag": "1.1.53",
"commit": "9444540a862f03f8aac0f2cd78e2da53ffe196d0"
"tag": "1.1.54",
"commit": "80b29ca19f79c58f1b9e7f105c5b637761a9c5f9"
},
"_source": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
"_target": "^1.1.51",

View file

@ -215,7 +215,7 @@
return connectUser;
};
var minServerVersion = '3.0.5782';
var minServerVersion = '3.0.5785';
self.minServerVersion = function (val) {
if (val) {

View file

@ -16,12 +16,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.2.53",
"_release": "1.2.53",
"version": "1.2.58",
"_release": "1.2.58",
"_resolution": {
"type": "version",
"tag": "1.2.53",
"commit": "818133a9b1b4b241b6f0e8e1733da3358bb02df5"
"tag": "1.2.58",
"commit": "523cb074208c7350bb68554c6fcde613142117f4"
},
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.0",

View file

@ -77,11 +77,18 @@ define(['browser'], function (browser) {
// Unfortunately there's no real way to detect mkv support
if (browser.chrome) {
var userAgent = navigator.userAgent.toLowerCase();
// Not supported on opera tv
if (browser.operaTv) {
return false;
}
// Filter out browsers based on chromium that don't support mkv
if (userAgent.indexOf('vivaldi') != -1 || userAgent.indexOf('opera') != -1) {
return false;
}
return true;
}

View file

@ -24,8 +24,6 @@
function onBackCommand(e) {
if (e.detail.command == 'back') {
inputManager.off(dlg, onBackCommand);
self.closedByBack = true;
closeDialog(dlg);
e.preventDefault();
@ -34,6 +32,9 @@
function onDialogClosed() {
inputManager.off(dlg, onBackCommand);
window.removeEventListener('popstate', onHashChange);
removeBackdrop(dlg);
dlg.classList.remove('opened');
@ -41,9 +42,6 @@
document.body.classList.remove('noScroll');
}
window.removeEventListener('popstate', onHashChange);
inputManager.off(dlg, onBackCommand);
if (!self.closedByBack && isHistoryEnabled(dlg)) {
var state = history.state || {};
if (state.dialogId == hash) {

View file

@ -1,10 +1,5 @@
define(['connectionManager', 'sharingMenu', 'loading'], function (connectionManager, sharingMenu, loading) {
function onSharingSuccess(options) {
console.log('share success. shareId: ' + options.share.Id);
}
function onSharingCancel(options, apiClient) {
var shareId = options.share.Id;
@ -24,7 +19,7 @@
loading.show();
var itemId = options.itemId;
var apiClient = options.apiClient || connectionManager.getApiClient(options.serverId);
var apiClient = connectionManager.getApiClient(options.serverId);
var userId = apiClient.getCurrentUserId();
return apiClient.getItem(userId, itemId).then(function () {
@ -45,7 +40,10 @@
};
loading.hide();
sharingMenu.showMenu(options, onSharingSuccess, function (options) {
sharingMenu.showMenu(options).then(function() {
console.log('share success. shareId: ' + options.share.Id);
}, function () {
onSharingCancel(options, apiClient);
});

View file

@ -1,34 +1,28 @@
define(['dialogHelper', 'thirdparty/social-share-kit-1.0.4/dist/js/social-share-kit.min', 'css!thirdparty/social-share-kit-1.0.4/dist/css/social-share-kit.css'], function (dialogHelper) {
define(['dialogHelper', 'layoutManager', 'dialogText', './social-share-kit-1.0.4/dist/js/social-share-kit.min', 'css!./social-share-kit-1.0.4/dist/css/social-share-kit.css'], function (dialogHelper, layoutManager, dialogText) {
function showMenu(options, successCallback, cancelCallback) {
function showMenu(options) {
var dlg = dialogHelper.createDialog({
removeOnClose: true,
autoFocus: false
autoFocus: layoutManager.tv
});
dlg.id = 'dlg' + new Date().getTime();
var html = '';
html += '<h2>' + Globalize.translate('HeaderShare') + '</h2>';
html += '<h2>' + Globalize.translate('Share') + '</h2>';
html += '<div>';
html += '<div class="ssk-group ssk-round ssk-lg">';
// We can only do facebook if we can guarantee that the current page is available over the internet, since FB will try to probe it.
if (Dashboard.isConnectMode()) {
html += '<a href="" class="ssk ssk-facebook"></a>';
}
html += '<a href="" class="ssk ssk-twitter"></a><a href="" class="ssk ssk-google-plus"></a><a href="" class="ssk ssk-pinterest"></a><a href="" class="ssk ssk-tumblr"></a></div>';
html += '</div>';
html += '<div style="max-width:240px;">';
html += Globalize.translate('ButtonShareHelp');
html += '</div>';
html += '<div class="buttons">';
html += '<paper-button class="btnCancel" dialog-dismiss>' + Globalize.translate('ButtonCancel') + '</paper-button>';
html += '<paper-button class="btnCancel">' + dialogText.get('Cancel') + '</paper-button>';
html += '</div>';
dlg.innerHTML = html;
@ -48,16 +42,6 @@
via: 'Emby'
});
// Has to be assigned a z-index after the call to .open()
dlg.addEventListener('close', function () {
if (isShared) {
successCallback(options);
} else {
cancelCallback(options);
}
});
function onSskButtonClick(e) {
isShared = true;
dialogHelper.close(dlg);
@ -74,7 +58,20 @@
dialogHelper.close(dlg);
});
var promise = new Promise(function (resolve, reject) {
dlg.addEventListener('close', function () {
if (isShared) {
resolve();
} else {
reject();
}
});
});
dialogHelper.open(dlg);
return promise;
}
return {

View file

@ -1,6 +1,6 @@
{
"name": "hls.js",
"version": "0.5.23",
"version": "0.5.24",
"license": "Apache-2.0",
"description": "Media Source Extension - HLS library, by/for Dailymotion",
"homepage": "https://github.com/dailymotion/hls.js",
@ -16,11 +16,11 @@
"test",
"tests"
],
"_release": "0.5.23",
"_release": "0.5.24",
"_resolution": {
"type": "version",
"tag": "v0.5.23",
"commit": "485756a33406adc4874027d9f20283935c61471c"
"tag": "v0.5.24",
"commit": "276d45148e6306e9ae06f4c9fa5778e723b78d05"
},
"_source": "git://github.com/dailymotion/hls.js.git",
"_target": "~0.5.7",

View file

@ -86,25 +86,12 @@ each error is categorized by :
- ```Hls.ErrorTypes.MEDIA_ERROR```for media/video related errors
- ```Hls.ErrorTypes.OTHER_ERROR```for all other errors
- its details:
- ```Hls.ErrorDetails.MANIFEST_LOAD_ERROR```raised when manifest loading fails because of a network error
- ```Hls.ErrorDetails.MANIFEST_LOAD_TIMEOUT```raised when manifest loading fails because of a timeout
- ```Hls.ErrorDetails.MANIFEST_PARSING_ERROR```raised when manifest parsing failed to find proper content
- ```Hls.ErrorDetails.LEVEL_LOAD_ERROR```raised when level loading fails because of a network error
- ```Hls.ErrorDetails.LEVEL_LOAD_TIMEOUT```raised when level loading fails because of a timeout
- ```Hls.ErrorDetails.LEVEL_SWITCH_ERROR```raised when level switching fails
- ```Hls.ErrorDetails.FRAG_LOAD_ERROR```raised when fragment loading fails because of a network error
- ```Hls.ErrorDetails.FRAG_LOOP_LOADING_ERROR```raised upon detection of same fragment being requested in loop
- ```Hls.ErrorDetails.FRAG_LOAD_TIMEOUT```raised when fragment loading fails because of a timeout
- ```Hls.ErrorDetails.FRAG_DECRYPT_ERROR```raised when fragment decryption fails
- ```Hls.ErrorDetails.FRAG_PARSING_ERROR```raised when fragment parsing fails
- ```Hls.ErrorDetails.BUFFER_APPEND_ERROR```raised when exception is raised while preparing buffer append
- ```Hls.ErrorDetails.BUFFER_APPENDING_ERROR```raised when exception is raised during buffer appending
- ```Hls.ErrorDetails.BUFFER_STALLED_ERROR```raised when playback stalls because the buffer runs out
- refer to [Errors details](#Errors)
- its fatality:
- ```false```if error is not fatal, hls.js will try to recover it
- ```true```if error is fatal, an action is required to (try to) recover it.
full details is described [below](##Errors)
full details is described [below](#Errors)
see sample code below to listen to errors:
@ -678,7 +665,9 @@ full list of Errors is described below:
- ```Hls.ErrorDetails.BUFFER_FULL_ERROR```raised when no data can be appended anymore in media buffer because it is full. this error is recovered automatically by performing a smooth level switching that empty buffers (without disrupting the playback) and reducing the max buffer length.
- data: { type : ```MEDIA_ERROR```, details : ```Hls.ErrorDetails.BUFFER_FULL_ERROR```, fatal : ```false```}
- ```Hls.ErrorDetails.BUFFER_SEEK_OVER_HOLE```raised after hls.js seeks over a buffer hole to unstuck the playback,
- data: { type : ```MEDIA_ERROR```, details : ```Hls.ErrorDetails.BUFFER_SEEK_OVER_HOLE```, fatal : ```false```}
- data: { type : ```MEDIA_ERROR```, details : ```Hls.ErrorDetails.BUFFER_SEEK_OVER_HOLE```, fatal : ```false```, hole : hole duration}
- ```Hls.ErrorDetails.BUFFER_SEEK_STUCK_IN_BUFFERED```raised after hls.js seeks to workaround a playback stuck although currentTime is buffered
- data: { type : ```MEDIA_ERROR```, details : ```Hls.ErrorDetails.BUFFER_SEEK_STUCK_IN_BUFFERED```, fatal : ```false```}
## Objects
### Level

View file

@ -1,6 +1,6 @@
{
"name": "hls.js",
"version": "0.5.23",
"version": "0.5.24",
"license": "Apache-2.0",
"description": "Media Source Extension - HLS library, by/for Dailymotion",
"homepage": "https://github.com/dailymotion/hls.js",

View file

@ -1410,7 +1410,7 @@ var LevelController = function (_EventHandler) {
return this._level;
},
set: function set(newLevel) {
if (this._level !== newLevel || this._levels[newLevel].details === undefined) {
if (this._levels && this._levels.length > newLevel && (this._level !== newLevel || this._levels[newLevel].details === undefined)) {
this.setLevelInternal(newLevel);
}
}
@ -2533,6 +2533,7 @@ var StreamController = function (_EventHandler) {
// check buffer upfront
// if less than jumpThreshold second is buffered, and media is expected to play but playhead is not moving,
// and we have a new buffer range available upfront, let's seek to that one
var configSeekHoleNudgeDuration = this.config.seekHoleNudgeDuration;
if (expectedPlaying && bufferInfo.len <= jumpThreshold) {
if (playheadMoving) {
// playhead moving
@ -2546,7 +2547,7 @@ var StreamController = function (_EventHandler) {
this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false });
this.stalled = true;
} else {
this.seekHoleNudgeDuration += this.config.seekHoleNudgeDuration;
this.seekHoleNudgeDuration += configSeekHoleNudgeDuration;
}
}
// if we are below threshold, try to jump if next buffer range is close
@ -2563,10 +2564,30 @@ var StreamController = function (_EventHandler) {
this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole: hole });
}
}
// in any case reset stalledInBuffered
this.stalledInBuffered = 0;
} else {
if (targetSeekPosition && media.currentTime !== targetSeekPosition) {
_logger.logger.log('adjust currentTime from ' + media.currentTime + ' to ' + targetSeekPosition);
media.currentTime = targetSeekPosition;
} else if (expectedPlaying && !playheadMoving) {
// if we are in this condition, it means that currentTime is in a buffered area, but playhead is not moving
// if that happens, we wait for a couple of cycle (config.stalledInBufferedNudgeThreshold), then we nudge
// media.currentTime to try to recover that situation.
if (this.stalledInBuffered !== undefined) {
this.stalledInBuffered++;
} else {
this.stalledInBuffered = 1;
}
if (this.stalledInBuffered >= this.config.stalledInBufferedNudgeThreshold) {
_logger.logger.log('playback stuck @ ' + media.currentTime + ', in buffered area, nudge currentTime by ' + configSeekHoleNudgeDuration);
this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_SEEK_STUCK_IN_BUFFERED, fatal: false });
media.currentTime += configSeekHoleNudgeDuration;
this.stalledInBuffered = 0;
}
} else {
// currentTime is buffered, playhead is moving or playback not expected... everything is fine
this.stalledInBuffered = 0;
}
}
}
@ -5175,6 +5196,8 @@ var ErrorDetails = exports.ErrorDetails = {
BUFFER_FULL_ERROR: 'bufferFullError',
// Identifier for a buffer seek over hole event
BUFFER_SEEK_OVER_HOLE: 'bufferSeekOverHole',
// Identifier for a seek triggered to workaround a playback stuck although currentTime is buffered
BUFFER_SEEK_STUCK_IN_BUFFERED: 'bufferSeekStuckInBuffered',
// Identifier for an internal exception happening inside hls.js while handling an event
INTERNAL_EXCEPTION: 'internalException'
};
@ -5198,6 +5221,12 @@ var _logger = require('./utils/logger');
var _errors = require('./errors');
var _events = require('./events');
var _events2 = _interopRequireDefault(_events);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var EventHandler = function () {
@ -5272,7 +5301,7 @@ var EventHandler = function () {
eventToFunction.call(this, event, data).call();
} catch (err) {
_logger.logger.error('internal error happened while processing ' + event + ':' + err.message);
this.hls.trigger(Event.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event: event, err: err });
this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event: event, err: err });
}
}
}]);
@ -5282,7 +5311,7 @@ var EventHandler = function () {
exports.default = EventHandler;
},{"./errors":20,"./utils/logger":36}],22:[function(require,module,exports){
},{"./errors":20,"./events":22,"./utils/logger":36}],22:[function(require,module,exports){
'use strict';
module.exports = {
@ -5713,6 +5742,7 @@ var Hls = function () {
maxBufferHole: 0.5,
maxSeekHole: 2,
seekHoleNudgeDuration: 0.01,
stalledInBufferedNudgeThreshold: 10,
maxFragLookUpTolerance: 0.2,
liveSyncDurationCount: 3,
liveMaxLatencyDurationCount: Infinity,

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,6 +1,6 @@
{
"name": "hls.js",
"version": "0.5.23",
"version": "0.5.24",
"license": "Apache-2.0",
"description": "Media Source Extension - HLS library, by/for Dailymotion",
"homepage": "https://github.com/dailymotion/hls.js",

View file

@ -113,7 +113,8 @@ class LevelController extends EventHandler {
}
set level(newLevel) {
if (this._level !== newLevel || this._levels[newLevel].details === undefined) {
if (this._levels && this._levels.length > newLevel &&
(this._level !== newLevel || this._levels[newLevel].details === undefined)) {
this.setLevelInternal(newLevel);
}
}

View file

@ -1018,6 +1018,7 @@ _checkBuffer() {
// check buffer upfront
// if less than jumpThreshold second is buffered, and media is expected to play but playhead is not moving,
// and we have a new buffer range available upfront, let's seek to that one
let configSeekHoleNudgeDuration = this.config.seekHoleNudgeDuration;
if(expectedPlaying && bufferInfo.len <= jumpThreshold) {
if(playheadMoving) {
// playhead moving
@ -1031,7 +1032,7 @@ _checkBuffer() {
this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: false});
this.stalled = true;
} else {
this.seekHoleNudgeDuration += this.config.seekHoleNudgeDuration;
this.seekHoleNudgeDuration += configSeekHoleNudgeDuration;
}
}
// if we are below threshold, try to jump if next buffer range is close
@ -1050,10 +1051,30 @@ _checkBuffer() {
this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole : hole});
}
}
// in any case reset stalledInBuffered
this.stalledInBuffered = 0;
} else {
if (targetSeekPosition && media.currentTime !== targetSeekPosition) {
logger.log(`adjust currentTime from ${media.currentTime} to ${targetSeekPosition}`);
media.currentTime = targetSeekPosition;
} else if (expectedPlaying && !playheadMoving) {
// if we are in this condition, it means that currentTime is in a buffered area, but playhead is not moving
// if that happens, we wait for a couple of cycle (config.stalledInBufferedNudgeThreshold), then we nudge
// media.currentTime to try to recover that situation.
if (this.stalledInBuffered !== undefined) {
this.stalledInBuffered++;
} else {
this.stalledInBuffered = 1;
}
if (this.stalledInBuffered >= this.config.stalledInBufferedNudgeThreshold) {
logger.log(`playback stuck @ ${media.currentTime}, in buffered area, nudge currentTime by ${configSeekHoleNudgeDuration}`);
this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_SEEK_STUCK_IN_BUFFERED, fatal: false});
media.currentTime+=configSeekHoleNudgeDuration;
this.stalledInBuffered = 0;
}
} else {
// currentTime is buffered, playhead is moving or playback not expected... everything is fine
this.stalledInBuffered = 0;
}
}
}

View file

@ -46,6 +46,8 @@ export const ErrorDetails = {
BUFFER_FULL_ERROR: 'bufferFullError',
// Identifier for a buffer seek over hole event
BUFFER_SEEK_OVER_HOLE: 'bufferSeekOverHole',
// Identifier for a seek triggered to workaround a playback stuck although currentTime is buffered
BUFFER_SEEK_STUCK_IN_BUFFERED : 'bufferSeekStuckInBuffered',
// Identifier for an internal exception happening inside hls.js while handling an event
INTERNAL_EXCEPTION: 'internalException'
};

View file

@ -6,6 +6,7 @@
import {logger} from './utils/logger';
import {ErrorTypes, ErrorDetails} from './errors';
import Event from './events';
class EventHandler {

View file

@ -48,6 +48,7 @@ class Hls {
maxBufferHole: 0.5,
maxSeekHole: 2,
seekHoleNudgeDuration : 0.01,
stalledInBufferedNudgeThreshold: 10,
maxFragLookUpTolerance : 0.2,
liveSyncDurationCount:3,
liveMaxLatencyDurationCount: Infinity,

View file

@ -1,6 +1,6 @@
{
"name": "iron-behaviors",
"version": "1.0.13",
"version": "1.0.14",
"description": "Provides a set of behaviors for the iron elements",
"private": true,
"authors": [
@ -30,11 +30,11 @@
},
"ignore": [],
"homepage": "https://github.com/PolymerElements/iron-behaviors",
"_release": "1.0.13",
"_release": "1.0.14",
"_resolution": {
"type": "version",
"tag": "v1.0.13",
"commit": "a7bc3428a6da2beed21987b3a8028206826a12bc"
"tag": "v1.0.14",
"commit": "c1d38a26219cf2e83b31a71a2bd8ae35ebee7ed7"
},
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
"_target": "^1.0.0",

View file

@ -0,0 +1,33 @@
<!-- Instructions: https://github.com/PolymerElements/iron-behaviors/CONTRIBUTING.md#filing-issues -->
### Description
<!-- Example: The `paper-foo` element causes the page to turn pink when clicked. -->
### Expected outcome
<!-- Example: The page stays the same color. -->
### Actual outcome
<!-- Example: The page turns pink. -->
### Live Demo
<!-- Example: https://jsbin.com/cagaye/edit?html,output -->
### Steps to reproduce
<!-- Example
1. Put a `paper-foo` element in the page.
2. Open the page in a web browser.
3. Click the `paper-foo` element.
-->
### Browsers Affected
<!-- Check all that apply -->
- [ ] Chrome
- [ ] Firefox
- [ ] Safari 9
- [ ] Safari 8
- [ ] Safari 7
- [ ] Edge
- [ ] IE 11
- [ ] IE 10

View file

@ -1,5 +1,5 @@
language: node_js
sudo: false
sudo: required
before_script:
- npm install -g bower polylint web-component-tester
- bower install
@ -8,18 +8,16 @@ env:
global:
- secure: ZOqj2XVNVwfT74rHxg/ljcAsS6FnmDpRSsXbsy1Icv9DcLHrMlmyQ10gWBjE/YXYF0Uv4akQ1qqn0TJaKOtp9HZeH+P6OPAYk2vJbWD7qp52pPtIqEFomcsUyflt4IjfaXKuN4FMod7PSWVSGJ+DxSguJvZKILkrs5d/rJdFv3c=
- secure: clkqemGQG16TXyAPkv9LBv6x3SbT3ZM0eo8LETx4uNKi3WzlwgXxZA9b5Sr5wYzxyxFFpnhDXW7CL4+UjYu1atGNeTW2TuSaYUPHtgu67OFDr8Jbw047p1XQb5enPSt9+YxrHKfjHBiJvWulJ8rCSQshU9Rhe0DC6NrFRPFgk0A=
- CXX=g++-4.8
node_js: stable
addons:
firefox: latest
apt:
sources:
- google-chrome
- ubuntu-toolchain-r-test
packages:
- google-chrome-stable
- g++-4.8
sauce_connect: true
script:
- xvfb-run wct
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
dist: trusty

View file

@ -1,6 +1,6 @@
{
"name": "iron-behaviors",
"version": "1.0.13",
"version": "1.0.14",
"description": "Provides a set of behaviors for the iron elements",
"private": true,
"authors": [

View file

@ -1,5 +1,6 @@
<!doctype html>
<!--
@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

View file

@ -1,4 +1,5 @@
<!--
@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

View file

@ -87,7 +87,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
this.style.pointerEvents = disabled ? 'none' : '';
if (disabled) {
this._oldTabIndex = this.tabIndex;
this.focused = false;
this._setFocused(false);
this.tabIndex = -1;
this.blur();
} else if (this._oldTabIndex !== undefined) {

View file

@ -1,5 +1,6 @@
<!doctype html>
<!--
@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

View file

@ -1,5 +1,6 @@
<!doctype html>
<!--
@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

View file

@ -1,5 +1,6 @@
<!doctype html>
<!--
@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

View file

@ -1,4 +1,5 @@
<!DOCTYPE html><!--
@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

View file

@ -1,4 +1,5 @@
<!--
@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

View file

@ -32,14 +32,14 @@
"web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-icon",
"homepage": "https://github.com/polymerelements/iron-icon",
"_release": "1.0.8",
"_resolution": {
"type": "version",
"tag": "v1.0.8",
"commit": "f36b38928849ef3853db727faa8c9ef104d611eb"
},
"_source": "git://github.com/PolymerElements/iron-icon.git",
"_source": "git://github.com/polymerelements/iron-icon.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-icon"
"_originalSource": "polymerelements/iron-icon"
}

View file

@ -1,6 +1,6 @@
{
"name": "iron-selector",
"version": "1.4.0",
"version": "1.5.0",
"description": "Manages a set of elements that can be selected",
"private": true,
"license": "http://polymer.github.io/LICENSE.txt",
@ -30,13 +30,13 @@
"web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"_release": "1.4.0",
"_release": "1.5.0",
"_resolution": {
"type": "version",
"tag": "v1.4.0",
"commit": "554f7418fdbd97688eb21518b5f8172167d53a95"
"tag": "v1.5.0",
"commit": "c7402274efa2e3b2a905ffa25d70c2ff3309dc59"
},
"_source": "git://github.com/PolymerElements/iron-selector.git",
"_source": "git://github.com/polymerelements/iron-selector.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-selector"
"_originalSource": "polymerelements/iron-selector"
}

View file

@ -1,5 +1,5 @@
language: node_js
sudo: false
sudo: required
before_script:
- npm install -g bower polylint web-component-tester
- bower install
@ -8,18 +8,16 @@ env:
global:
- secure: ltCkwJM0nkTS9WjikyjqBsB5J2hQon4UnVVrINk4y+Vq4v9PQJH3+83nya0jnxilKaeAJs4d2/OS02F9GkqYpsSmDz7OgXPfk0hrHA8UksvvpSALfnukleIAN2YTOcxXJKeNHcfpqCKPk1dGeNQOEM61H+QgTBIyFB3sMugygqs=
- secure: TJuu1WdpFLTaBN/prBafm8Pld/BQCySNuuG1nATbF3fqiOpgehXu8Z5URAz5syUhqZAyEmuRMxvXpEVD/t1jrtaXVwkdCFkkQ4ckkP4gTIeSGA/Puw8sveB2q7QAqXyTmeFkocNlh8fxV+B07o0SPWdhcvdZnDVU9VrpSqL+92M=
- CXX=g++-4.8
node_js: stable
addons:
firefox: latest
apt:
sources:
- google-chrome
- ubuntu-toolchain-r-test
packages:
- google-chrome-stable
- g++-4.8
sauce_connect: true
script:
- xvfb-run wct
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
dist: trusty

View file

@ -1,6 +1,6 @@
{
"name": "iron-selector",
"version": "1.4.0",
"version": "1.5.0",
"description": "Manages a set of elements that can be selected",
"private": true,
"license": "http://polymer.github.io/LICENSE.txt",

View file

@ -220,6 +220,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
this.selected = this._indexToValue(index);
},
/**
* Selects the item at the given index.
*
* @method selectIndex
*/
selectIndex: function(index) {
this.select(this._indexToValue(index));
},
/**
* Force a synchronous update of the `items` property.
*

View file

@ -154,6 +154,35 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
expect(s2.items.length).to.be.equal(6);
});
suite('`select()` and `selectIndex()`', function() {
test('`select()` selects an item with the given value', function() {
s2.select('item1');
assert.equal(s2.selected, 'item1');
s2.select('item3');
assert.equal(s2.selected, 'item3');
s2.select('item2');
assert.equal(s2.selected, 'item2');
});
test('`selectIndex()` selects an item with the given index', function() {
assert.equal(s2.selectedItem, undefined);
s2.selectIndex(1);
assert.equal(s2.selected, 'item1');
assert.equal(s2.selectedItem, s2.items[1]);
s2.selectIndex(3);
assert.equal(s2.selected, 'item3');
assert.equal(s2.selectedItem, s2.items[3]);
s2.selectIndex(4);
assert.equal(s2.selected, 'item4');
assert.equal(s2.selectedItem, s2.items[4]);
});
});
suite('items changing', function() {
var s1;

View file

@ -45,6 +45,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template>
</test-fixture>
<test-fixture id="valueById">
<template>
<iron-selector multi attr-for-selected="id">
<div id="item0">Item 0</div>
<div id="item1">Item 1</div>
<div id="item2">Item 2</div>
<div id="item3">Item 3</div>
<div id="item4">Item 4</div>
</iron-selector>
</template>
</test-fixture>
<!--
NOTE(cdata): Enable test-fixture when polymer/polymer#2495 is resolved
-->
@ -301,6 +313,48 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
suite('`select()` and `selectIndex()`', function() {
var selector;
setup(function() {
selector = fixture('valueById');
});
test('`select()` selects an item with the given value', function() {
selector.select('item1');
assert.equal(selector.selectedValues.length, 1);
assert.equal(selector.selectedValues.indexOf('item1'), 0);
selector.select('item3');
assert.equal(selector.selectedValues.length, 2);
assert.isTrue(selector.selectedValues.indexOf('item3') >= 0);
selector.select('item2');
assert.equal(selector.selectedValues.length, 3);
assert.isTrue(selector.selectedValues.indexOf('item2') >= 0);
});
test('`selectIndex()` selects an item with the given index', function() {
selector.selectIndex(1);
assert.equal(selector.selectedValues.length, 1);
assert.isTrue(selector.selectedValues.indexOf('item1') >= 0);
assert.equal(selector.selectedItems.length, 1);
assert.isTrue(selector.selectedItems.indexOf(selector.items[1]) >= 0);
selector.selectIndex(3);
assert.equal(selector.selectedValues.length, 2);
assert.isTrue(selector.selectedValues.indexOf('item3') >= 0);
assert.equal(selector.selectedItems.length, 2);
assert.isTrue(selector.selectedItems.indexOf(selector.items[3]) >= 0);
selector.selectIndex(0);
assert.equal(selector.selectedValues.length, 3);
assert.isTrue(selector.selectedValues.indexOf('item0') >= 0);
assert.equal(selector.selectedItems.length, 3);
assert.isTrue(selector.selectedItems.indexOf(selector.items[0]) >= 0);
});
});
/* test('toggle multi from true to false', function() {
// set selected
s.selected = [0, 2];

View file

@ -56,6 +56,9 @@
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);
var pagingHtml = LibraryBrowser.getQueryPagingHtml({
startIndex: query.StartIndex,
limit: query.Limit,

View file

@ -1647,10 +1647,10 @@ var AppInfo = {};
paths.wakeonlan = "cordova/wakeonlan";
paths.actionsheet = "cordova/actionsheet";
} else {
paths.sharingMenu = "components/sharingwidget";
paths.serverdiscovery = apiClientBowerPath + "/serverdiscovery";
paths.wakeonlan = apiClientBowerPath + "/wakeonlan";
define("sharingMenu", [embyWebComponentsBowerPath + "/sharing/sharingmenu"], returnFirstDependency);
define("actionsheet", [embyWebComponentsBowerPath + "/actionsheet/actionsheet"], returnFirstDependency);
}
@ -1671,13 +1671,17 @@ var AppInfo = {};
define("sharingmanager", [embyWebComponentsBowerPath + "/sharing/sharingmanager"], returnFirstDependency);
if (Dashboard.isRunningInCordova()) {
paths.apphost = "cordova/apphost";
} else {
paths.apphost = "components/apphost";
}
// hack for an android test before browserInfo is loaded
if (Dashboard.isRunningInCordova() && window.MainActivity) {
paths.appStorage = "cordova/android/appstorage";
paths.apphost = "cordova/apphost";
} else {
paths.appStorage = apiClientBowerPath + "/appstorage";
paths.apphost = "components/apphost";
}
paths.playlistManager = "scripts/playlistmanager";
@ -2071,6 +2075,9 @@ var AppInfo = {};
drawer.disableEdgeSwipe = true;
}
// Default is 600px
drawer.responsiveWidth = '640px';
var deps = [];
deps.push('scripts/extensions');

View file

@ -54,6 +54,9 @@
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);
updateFilterControls(page);
var pagingHtml = LibraryBrowser.getQueryPagingHtml({

View file

@ -2221,8 +2221,7 @@
"ErrorMessageUsernameInUse": "The username is already in use. Please choose a new name and try again.",
"ErrorMessageEmailInUse": "The email address is already in use. Please enter a new email address and try again, or use the forgot password feature.",
"MessageThankYouForConnectSignUp": "Thank you for signing up for Emby Connect. An email will be sent to your address with instructions on how to confirm your new account. Please confirm the account and then return here to sign in.",
"HeaderShare": "Share",
"ButtonShareHelp": "Share a web page containing media information with social media. Media files are never shared publicly.",
"Share": "Share",
"ButtonShare": "Share",
"HeaderConfirm": "Confirm",
"MessageConfirmDeleteTunerDevice": "Are you sure you wish to delete this device?",