mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
adb3a60373
commit
95b1778220
11 changed files with 171 additions and 74 deletions
|
@ -15,12 +15,12 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"version": "1.0.65",
|
"version": "1.0.70",
|
||||||
"_release": "1.0.65",
|
"_release": "1.0.70",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "1.0.65",
|
"tag": "1.0.70",
|
||||||
"commit": "2117b3bb2d88bef07f2c150101683db8857021dd"
|
"commit": "db75421f647d89be91ee5de3157770598939a3d6"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
|
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
|
||||||
"_target": "~1.0.0",
|
"_target": "~1.0.0",
|
||||||
|
|
|
@ -6,8 +6,13 @@ define(['paperdialoghelper', 'layoutManager', 'html!./icons.html', 'css!./style.
|
||||||
removeOnClose: true
|
removeOnClose: true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var backButton = false;
|
||||||
|
var raisedButtons = false;
|
||||||
|
|
||||||
if (layoutManager.tv) {
|
if (layoutManager.tv) {
|
||||||
dialogOptions.size = 'fullscreen';
|
dialogOptions.size = 'fullscreen';
|
||||||
|
backButton = true;
|
||||||
|
raisedButtons = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var dlg = paperdialoghelper.createDialog(dialogOptions);
|
var dlg = paperdialoghelper.createDialog(dialogOptions);
|
||||||
|
@ -17,20 +22,21 @@ define(['paperdialoghelper', 'layoutManager', 'html!./icons.html', 'css!./style.
|
||||||
var html = '';
|
var html = '';
|
||||||
var submitValue = '';
|
var submitValue = '';
|
||||||
|
|
||||||
html += '<div style="margin:0;padding:0;width:50%;text-align:left;">';
|
html += '<div class="promptDialogContent">';
|
||||||
html += '<paper-icon-button tabindex="-1" icon="dialog:arrow-back" class="btnPromptExit"></paper-icon-button>';
|
if (backButton) {
|
||||||
|
html += '<paper-icon-button tabindex="-1" icon="dialog:arrow-back" class="btnPromptExit"></paper-icon-button>';
|
||||||
if (options.title) {
|
|
||||||
html += '<h1 style="margin-bottom:0;">';
|
|
||||||
html += options.title;
|
|
||||||
html += '</h1>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '<paper-input autoFocus class="txtPromptValue"></paper-input>';
|
html += '<paper-input autoFocus class="txtPromptValue"></paper-input>';
|
||||||
|
|
||||||
// TODO: An actual form element should probably be added
|
// TODO: An actual form element should probably be added
|
||||||
html += '<br/>';
|
html += '<br/>';
|
||||||
html += '<paper-button raised class="block paperSubmit"><iron-icon icon="dialog:check"></iron-icon><span>' + Globalize.translate('core#ButtonOk') + '</span></paper-button>';
|
if (raisedButtons) {
|
||||||
|
html += '<paper-button raised class="btnSubmit"><iron-icon icon="dialog:check"></iron-icon><span>' + Globalize.translate('core#ButtonOk') + '</span></paper-button>';
|
||||||
|
} else {
|
||||||
|
html += '<paper-button class="btnSubmit">' + Globalize.translate('core#ButtonOk') + '</paper-button>';
|
||||||
|
html += '<paper-button class="btnPromptExit">' + Globalize.translate('core#ButtonCancel') + '</paper-button>';
|
||||||
|
}
|
||||||
|
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
|
@ -40,9 +46,13 @@ define(['paperdialoghelper', 'layoutManager', 'html!./icons.html', 'css!./style.
|
||||||
dlg.querySelector('.txtPromptValue').value = options.text;
|
dlg.querySelector('.txtPromptValue').value = options.text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.title) {
|
||||||
|
dlg.querySelector('.txtPromptValue').label = options.title;
|
||||||
|
}
|
||||||
|
|
||||||
document.body.appendChild(dlg);
|
document.body.appendChild(dlg);
|
||||||
|
|
||||||
dlg.querySelector('.paperSubmit').addEventListener('click', function (e) {
|
dlg.querySelector('.btnSubmit').addEventListener('click', function (e) {
|
||||||
|
|
||||||
submitValue = dlg.querySelector('.txtPromptValue').value;
|
submitValue = dlg.querySelector('.txtPromptValue').value;
|
||||||
paperdialoghelper.close(dlg);
|
paperdialoghelper.close(dlg);
|
||||||
|
|
|
@ -6,7 +6,26 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btnPromptExit {
|
.txtPromptValue label {
|
||||||
|
font-size: 200%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.promptDialogContent {
|
||||||
|
text-align: left;
|
||||||
|
padding: 2em;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.promptDialog.fullscreen .promptDialogContent {
|
||||||
|
padding: 0;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.promptDialog.fullscreen .btnSubmit {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.promptDialog.fullscreen .btnPromptExit {
|
||||||
z-index: 1002;
|
z-index: 1002;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: .5em;
|
top: .5em;
|
||||||
|
@ -14,7 +33,3 @@
|
||||||
width: 5.2vh;
|
width: 5.2vh;
|
||||||
height: 5.2vh;
|
height: 5.2vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.txtPromptValue label {
|
|
||||||
font-size: 200%;
|
|
||||||
}
|
|
||||||
|
|
|
@ -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"
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "iron-selector",
|
"name": "iron-selector",
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"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,13 +30,13 @@
|
||||||
"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.0",
|
"_release": "1.2.1",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.2.0",
|
"tag": "v1.2.1",
|
||||||
"commit": "17a94bd1555d3321f4ecefd472f0c470d48e9e94"
|
"commit": "1e6a7ee05e5ff350472ffc1ee780f145a7606b7b"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/polymerelements/iron-selector.git",
|
"_source": "git://github.com/PolymerElements/iron-selector.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
"_originalSource": "polymerelements/iron-selector"
|
"_originalSource": "PolymerElements/iron-selector"
|
||||||
}
|
}
|
|
@ -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:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "iron-selector",
|
"name": "iron-selector",
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"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",
|
||||||
|
|
|
@ -281,7 +281,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
},
|
},
|
||||||
|
|
||||||
_valueForItem: function(item) {
|
_valueForItem: function(item) {
|
||||||
return item[this.attrForSelected] || item.getAttribute(this.attrForSelected);
|
var propValue = item[this.attrForSelected];
|
||||||
|
return propValue != undefined ? propValue : item.getAttribute(this.attrForSelected);
|
||||||
},
|
},
|
||||||
|
|
||||||
_applySelection: function(item, isSelected) {
|
_applySelection: function(item, isSelected) {
|
||||||
|
|
|
@ -25,6 +25,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
'basic.html',
|
'basic.html',
|
||||||
'multi.html',
|
'multi.html',
|
||||||
'next-previous.html',
|
'next-previous.html',
|
||||||
|
'numeric-ids.html',
|
||||||
'selected-attribute.html',
|
'selected-attribute.html',
|
||||||
'template-repeat.html',
|
'template-repeat.html',
|
||||||
'content.html',
|
'content.html',
|
||||||
|
|
72
dashboard-ui/bower_components/iron-selector/test/numeric-ids.html
vendored
Normal file
72
dashboard-ui/bower_components/iron-selector/test/numeric-ids.html
vendored
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
<!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-numeric-ids</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>
|
||||||
|
|
||||||
|
<link rel="import" href="../iron-selector.html">
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.iron-selected {
|
||||||
|
background: #ccc;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<template is="dom-bind">
|
||||||
|
<iron-selector id="selector" attr-for-selected="name">
|
||||||
|
<template id="t" is="dom-repeat">
|
||||||
|
<div name="[[item.id]]">{{item.name}}</div>
|
||||||
|
</template>
|
||||||
|
</iron-selector>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
suite('select by a numeric property', function() {
|
||||||
|
|
||||||
|
var scope, s, t;
|
||||||
|
|
||||||
|
setup(function() {
|
||||||
|
scope = document.querySelector('template[is="dom-bind"]');
|
||||||
|
s = scope.$.selector;
|
||||||
|
t = scope.$.t;
|
||||||
|
t.items = [{ id: 0, name:'item0'}, {id: 1, name: 'item1'}, {id: 2, name: 'item2'}];
|
||||||
|
});
|
||||||
|
|
||||||
|
teardown(function() {
|
||||||
|
t.items = [];
|
||||||
|
});
|
||||||
|
|
||||||
|
test('select a value of zero', function() {
|
||||||
|
t.render();
|
||||||
|
s.selected = 1;
|
||||||
|
assert.equal(s.selected, '1');
|
||||||
|
|
||||||
|
// select item with a name value of 0
|
||||||
|
s.children[0].dispatchEvent(new CustomEvent('tap', {bubbles: true}));
|
||||||
|
assert.equal(s.selected, 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -54,52 +54,45 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
t.items = [];
|
t.items = [];
|
||||||
});
|
});
|
||||||
|
|
||||||
test('supports repeated items', function(done) {
|
test('supports repeated items', function() {
|
||||||
setTimeout(function() {
|
t.render();
|
||||||
// check items
|
// check items
|
||||||
assert.equal(s.items.length, 4);
|
assert.equal(s.items.length, 4);
|
||||||
// check selected
|
// check selected
|
||||||
assert.equal(s.selected, 1);
|
assert.equal(s.selected, 1);
|
||||||
// check selected item
|
// check selected item
|
||||||
var item = s.selectedItem;
|
var item = s.selectedItem;
|
||||||
assert.equal(s.items[1], item);
|
assert.equal(s.items[1], item);
|
||||||
// check selected class
|
// check selected class
|
||||||
assert.isTrue(item.classList.contains('iron-selected'));
|
assert.isTrue(item.classList.contains('iron-selected'));
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('update items', function(done) {
|
test('update items', function() {
|
||||||
setTimeout(function() {
|
t.render();
|
||||||
// check items
|
// check items
|
||||||
assert.equal(s.items.length, 4);
|
assert.equal(s.items.length, 4);
|
||||||
// check selected
|
// check selected
|
||||||
assert.equal(s.selected, 1);
|
assert.equal(s.selected, 1);
|
||||||
// update items
|
// update items
|
||||||
t.items = [{name:'foo'}, {name: 'bar'}];
|
t.items = [{name:'foo'}, {name: 'bar'}];
|
||||||
setTimeout(function() {
|
t.render();
|
||||||
// check items
|
// check items
|
||||||
assert.equal(s.items.length, 2);
|
assert.equal(s.items.length, 2);
|
||||||
// check selected (should still honor the selected)
|
// check selected (should still honor the selected)
|
||||||
assert.equal(s.selected, 1);
|
assert.equal(s.selected, 1);
|
||||||
// check selected class
|
// check selected class
|
||||||
assert.isTrue(s.querySelector('#bar').classList.contains('iron-selected'));
|
assert.isTrue(s.querySelector('#bar').classList.contains('iron-selected'));
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('set selected to something else', function(done) {
|
test('set selected to something else', function() {
|
||||||
setTimeout(function() {
|
t.render();
|
||||||
// set selected to something else
|
// set selected to something else
|
||||||
s.selected = 3;
|
s.selected = 3;
|
||||||
// check selected item
|
// check selected item
|
||||||
var item = s.selectedItem;
|
var item = s.selectedItem;
|
||||||
assert.equal(s.items[3], item);
|
assert.equal(s.items[3], item);
|
||||||
// check selected class
|
// check selected class
|
||||||
assert.isTrue(item.classList.contains('iron-selected'));
|
assert.isTrue(item.classList.contains('iron-selected'));
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue