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

fix subtitles in ms edge

This commit is contained in:
Luke Pulverenti 2016-03-09 19:05:29 -05:00
parent 71811cb9e3
commit 4f48507a2d
12 changed files with 231 additions and 25 deletions

View file

@ -16,12 +16,12 @@
}, },
"devDependencies": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.1.29", "version": "1.1.30",
"_release": "1.1.29", "_release": "1.1.30",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.1.29", "tag": "1.1.30",
"commit": "5884bd203d5dcf32cc0e325018284bd078ac0c41" "commit": "25a55da9b6507b8e0b81dbde2c69f21af98abce8"
}, },
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git", "_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "~1.1.5", "_target": "~1.1.5",

View file

@ -18,6 +18,10 @@
var vpWidth = window.innerWidth, var vpWidth = window.innerWidth,
vpHeight = window.innerHeight; vpHeight = window.innerHeight;
if (!elem.getBoundingClientRect){
return true;
}
// Use this native browser method, if available. // Use this native browser method, if available.
var rec = elem.getBoundingClientRect(), var rec = elem.getBoundingClientRect(),
tViz = rec.top >= 0 && rec.top < vpHeight + thresholdY, tViz = rec.top >= 0 && rec.top < vpHeight + thresholdY,

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-selector", "name": "iron-selector",
"version": "1.2.4", "version": "1.2.5",
"description": "Manages a set of elements that can be selected", "description": "Manages a set of elements that can be selected",
"private": true, "private": true,
"license": "http://polymer.github.io/LICENSE.txt", "license": "http://polymer.github.io/LICENSE.txt",
@ -30,11 +30,11 @@
"web-component-tester": "^4.0.0", "web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"_release": "1.2.4", "_release": "1.2.5",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.2.4", "tag": "v1.2.5",
"commit": "1ee4e2e11a9e5118320987d93fc2c03ae9a489f4" "commit": "06bd256eacfd70f959c4aed8c03c221f01074c0f"
}, },
"_source": "git://github.com/PolymerElements/iron-selector.git", "_source": "git://github.com/PolymerElements/iron-selector.git",
"_target": "^1.0.0", "_target": "^1.0.0",

View file

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

View file

@ -46,8 +46,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
properties: { properties: {
/** /**
* If you want to use the attribute value of an element for `selected` instead of the index, * If you want to use an attribute value or property of an element for
* set this to the name of the attribute. * `selected` instead of the index, set this to the name of the attribute
* or property. Hyphenated values are converted to camel case when used to
* look up the property of a selectable element. Camel cased values are
* *not* converted to hyphenated values for attribute lookup. It's
* recommended that you provide the hyphenated form of the name so that
* selection works in both cases. (Use `attr-or-property-name` instead of
* `attrOrPropertyName`.)
*/ */
attrForSelected: { attrForSelected: {
type: String, type: String,
@ -288,7 +294,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}, },
_valueForItem: function(item) { _valueForItem: function(item) {
var propValue = item[this.attrForSelected]; var propValue = item[Polymer.CaseMap.dashToCamelCase(this.attrForSelected)];
return propValue != undefined ? propValue : item.getAttribute(this.attrForSelected); return propValue != undefined ? propValue : item.getAttribute(this.attrForSelected);
}, },

View file

@ -0,0 +1,29 @@
<!--
Copyright (c) 2016 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="attr-reflector">
<template>
<div>{{someAttr}}</div>
</template>
<script>
Polymer({
is: 'attr-reflector',
properties: {
someAttr: {
type: String,
value: "",
reflectToAttribute: true
}
}
});
</script>
</dom-module>

View file

@ -0,0 +1,163 @@
<!doctype html>
<!--
Copyright (c) 2016 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
-->
<html>
<head>
<title>iron-selector attr-for-selected</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<script src="../../test-fixture/test-fixture-mocha.js"></script>
<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="../../iron-test-helpers/iron-test-helpers.html">
<link rel="import" href="../iron-selector.html">
<link rel="import" href="attr-for-selected-elements.html">
<style>
.iron-selected {
background: #ccc;
}
.my-selected {
background: red;
}
</style>
</head>
<body>
<test-fixture id="inlineAttributes">
<template>
<iron-selector attr-for-selected="some-attr">
<div some-attr="value0">Item 0</div>
<div some-attr="value1">Item 1</div>
<div some-attr="value2">Item 2</div>
</iron-selector>
</template>
</test-fixture>
<test-fixture id="reflectedProperties">
<template>
<iron-selector attr-for-selected="some-attr">
<attr-reflector>Item 0</attr-reflector>
<attr-reflector>Item 1</attr-reflector>
<attr-reflector>Item 2</attr-reflector>
</iron-selector>
</template>
</test-fixture>
<test-fixture id="mixedPropertiesAndAttributes">
<template>
<iron-selector attr-for-selected="some-attr">
<attr-reflector>Item 0</attr-reflector>
<attr-reflector>Item 1</attr-reflector>
<div some-attr="value2">Item 2</div>
<div some-attr="value3">Item 3</div>
<attr-reflector>Item 4</attr-reflector>
<div some-attr="value5">Item 5</div>
</iron-selector>
</template>
</test-fixture>
<script>
suite('inline attributes', function() {
var selector;
var items;
setup(function () {
selector = fixture('inlineAttributes');
items = Array.prototype.slice.apply(selector.querySelectorAll('div[some-attr]'));
});
test('selecting value programatically selects correct item', function() {
selector.select('value1');
assert.equal(selector.selectedItem, items[1]);
});
test('selecting item sets the correct selected value', function(done) {
MockInteractions.downAndUp(items[2], function() {
assert.equal(selector.selected, 'value2');
done();
});
});
});
suite('reflected properties as attributes', function() {
var selector;
var items;
setup(function () {
selector = fixture('reflectedProperties');
items = Array.prototype.slice.apply(selector.querySelectorAll('attr-reflector'));
for (var i = 0; i < items.length; i++) {
items[i].someAttr = "value" + i;
}
});
test('selecting value programatically selects correct item', function() {
selector.select('value1');
assert.equal(selector.selectedItem, items[1]);
});
test('selecting item sets the correct selected value', function(done) {
MockInteractions.downAndUp(items[2], function() {
assert.equal(selector.selected, 'value2');
done();
});
});
});
suite('mixed properties and inline attributes', function() {
var selector;
var items;
setup(function () {
selector = fixture('mixedPropertiesAndAttributes');
items = Array.prototype.slice.apply(selector.querySelectorAll('attr-reflector, div[some-attr]'));
for (var i = 0; i < items.length; i++) {
items[i].someAttr = "value" + i;
}
});
test('selecting value programatically selects correct item', function() {
for (var i = 0; i < items.length; i++) {
selector.select('value' + i);
assert.equal(selector.selectedItem, items[i]);
}
});
test('selecting item sets the correct selected value', function(done) {
var i = 0;
function testSelectItem(i) {
if (i >= items.length) {
done();
return;
}
MockInteractions.downAndUp(items[i], function() {
assert.equal(selector.selected, 'value' + i);
testSelectItem(i + 1);
});
}
testSelectItem(i);
});
});
</script>
</body>
</html>

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

@ -32,14 +32,14 @@
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0" "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0"
}, },
"ignore": [], "ignore": [],
"homepage": "https://github.com/PolymerElements/paper-ripple", "homepage": "https://github.com/polymerelements/paper-ripple",
"_release": "1.0.5", "_release": "1.0.5",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.5", "tag": "v1.0.5",
"commit": "d72e7a9a8ab518b901ed18dde492df3b87a93be5" "commit": "d72e7a9a8ab518b901ed18dde492df3b87a93be5"
}, },
"_source": "git://github.com/PolymerElements/paper-ripple.git", "_source": "git://github.com/polymerelements/paper-ripple.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "PolymerElements/paper-ripple" "_originalSource": "polymerelements/paper-ripple"
} }

View file

@ -271,8 +271,13 @@
$('#txtSignupPassword', page).val(''); $('#txtSignupPassword', page).val('');
$('#txtSignupPasswordConfirm', page).val(''); $('#txtSignupPasswordConfirm', page).val('');
var link = '<a href="http://emby.media" target="_blank">http://emby.media</a>'; if (browserInfo.safari && AppInfo.isNativeApp) {
$('.embyIntroDownloadMessage', page).html(Globalize.translate('EmbyIntroDownloadMessage', link)); // With apple we can't even have a link to the site
$('.embyIntroDownloadMessage', page).html(Globalize.translate('EmbyIntroDownloadMessageWithoutLink'));
} else {
var link = '<a href="http://emby.media" target="_blank">http://emby.media</a>';
$('.embyIntroDownloadMessage', page).html(Globalize.translate('EmbyIntroDownloadMessage', link));
}
}).on('pageshow', "#connectLoginPage", function () { }).on('pageshow', "#connectLoginPage", function () {

View file

@ -512,11 +512,9 @@
function enableNativeTrackSupport(track) { function enableNativeTrackSupport(track) {
if (browserInfo.safari) { if (browserInfo.safari && browserInfo.mobile) {
if (navigator.userAgent.toLowerCase().indexOf('os x') == -1) { // Leave it to apple to have different behavior between safari on ios vs osx
// Leave it to apple to have different behavior between safari on ios vs osx return false;
return false;
}
} }
if (browserInfo.firefox) { if (browserInfo.firefox) {
@ -648,7 +646,7 @@
console.log('expectedId: ' + expectedId + '--currentTrack.Id:' + currentTrack.id); console.log('expectedId: ' + expectedId + '--currentTrack.Id:' + currentTrack.id);
// IE doesn't support track id // IE doesn't support track id
if (browserInfo.msie) { if (browserInfo.msie || browserInfo.edge) {
if (trackIndex == i) { if (trackIndex == i) {
mode = 1; // show this track mode = 1; // show this track
} else { } else {

View file

@ -2294,6 +2294,7 @@
"LabelProfile": "Profile:", "LabelProfile": "Profile:",
"LabelBitrateMbps": "Bitrate (Mbps):", "LabelBitrateMbps": "Bitrate (Mbps):",
"EmbyIntroDownloadMessage": "To download and install Emby Server visit {0}.", "EmbyIntroDownloadMessage": "To download and install Emby Server visit {0}.",
"EmbyIntroDownloadMessageWithoutLink": "To download and install Emby Server visit the Emby website.",
"ButtonNewServer": "New Server", "ButtonNewServer": "New Server",
"ButtonSignInWithConnect": "Sign in with Emby Connect", "ButtonSignInWithConnect": "Sign in with Emby Connect",
"MyDevice": "My Device", "MyDevice": "My Device",