mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update polymer
This commit is contained in:
parent
8119b930e4
commit
cbb6337b41
74 changed files with 2195 additions and 1393 deletions
|
@ -19,7 +19,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<script>
|
||||
WCT.loadSuites([
|
||||
'paper-button-behavior.html',
|
||||
'paper-radio-button-behavior.html'
|
||||
'paper-radio-button-behavior.html',
|
||||
'paper-checked-element-behavior.html',
|
||||
'paper-ripple-behavior.html'
|
||||
]);
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -39,19 +39,20 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
});
|
||||
|
||||
test('normal (no states)', function() {
|
||||
assert.equal(button._elevation, 1);
|
||||
assert.equal(button.elevation, 1);
|
||||
});
|
||||
|
||||
test('set disabled property', function() {
|
||||
button.disabled = true;
|
||||
assert.equal(button._elevation, 0);
|
||||
assert.equal(button.elevation, 0);
|
||||
});
|
||||
|
||||
test('pressed and released', function() {
|
||||
MockInteractions.down(button);
|
||||
assert.equal(button._elevation, 4);
|
||||
assert.equal(button.elevation, 4);
|
||||
MockInteractions.up(button);
|
||||
assert.equal(button._elevation, 1);
|
||||
assert.equal(button.elevation, 1);
|
||||
assert.ok(button.hasRipple());
|
||||
});
|
||||
|
||||
suite('a button with toggles', function() {
|
||||
|
@ -62,7 +63,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
test('activated by tap', function(done) {
|
||||
MockInteractions.downAndUp(button, function() {
|
||||
try {
|
||||
assert.equal(button._elevation, 4);
|
||||
assert.equal(button.elevation, 4);
|
||||
assert.ok(button.hasRipple());
|
||||
done();
|
||||
} catch (e) {
|
||||
done(e);
|
||||
|
@ -73,7 +75,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
test('receives focused', function() {
|
||||
MockInteractions.focus(button);
|
||||
assert.equal(button._elevation, 3);
|
||||
assert.equal(button.elevation, 3);
|
||||
assert.ok(button.hasRipple());
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
94
dashboard-ui/bower_components/paper-behaviors/test/paper-checked-element-behavior.html
vendored
Normal file
94
dashboard-ui/bower_components/paper-behaviors/test/paper-checked-element-behavior.html
vendored
Normal file
|
@ -0,0 +1,94 @@
|
|||
<!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
|
||||
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>paper-checked-element-behavior</title>
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
<script src="../../iron-test-helpers/mock-interactions.js"></script>
|
||||
|
||||
<link rel="import" href="../../polymer/polymer.html">
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="../paper-checked-element-behavior.html">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<dom-module id="test-checked">
|
||||
<template>
|
||||
</template>
|
||||
<script>
|
||||
HTMLImports.whenReady(function() {
|
||||
Polymer({
|
||||
is: 'test-checked',
|
||||
behaviors: [
|
||||
Polymer.PaperCheckedElementBehavior
|
||||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
||||
|
||||
<test-fixture id="basic">
|
||||
<template>
|
||||
<test-checked></test-checked>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
suite('PaperCheckedElementBehavior', function() {
|
||||
var checked;
|
||||
|
||||
setup(function() {
|
||||
checked = fixture('basic');
|
||||
});
|
||||
|
||||
test('element checked when tapped to check', function() {
|
||||
MockInteractions.tap(checked);
|
||||
assert.isTrue(checked.checked);
|
||||
});
|
||||
|
||||
test('element checked when active', function() {
|
||||
checked.active = true;
|
||||
assert.isTrue(checked.checked);
|
||||
});
|
||||
|
||||
test('element not checked when disabled and made active', function() {
|
||||
checked.disabled = true;
|
||||
checked.active = true;
|
||||
assert.isFalse(checked.checked);
|
||||
});
|
||||
|
||||
test('element not checked when disabled and tapped', function() {
|
||||
checked.disabled = true;
|
||||
MockInteractions.tap(checked);
|
||||
assert.isFalse(checked.checked);
|
||||
});
|
||||
|
||||
test('element ripple has checked attribute when element tapped to check', function() {
|
||||
MockInteractions.tap(checked);
|
||||
assert.isTrue(checked.hasRipple());
|
||||
assert.isTrue(checked.getRipple().hasAttribute('checked'));
|
||||
});
|
||||
|
||||
test('element ripple does not have checked attribute when element tapped to uncheck', function() {
|
||||
MockInteractions.tap(checked);
|
||||
MockInteractions.tap(checked);
|
||||
assert.isFalse(checked.getRipple().hasAttribute('checked'));
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -33,26 +33,22 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<script>
|
||||
suite('basic', function() {
|
||||
var button;
|
||||
var ink;
|
||||
|
||||
setup(function() {
|
||||
button = fixture('basic');
|
||||
ink = button.querySelector('paper-ripple');
|
||||
MockInteractions.blur(button);
|
||||
});
|
||||
|
||||
test('normal (no states)', function() {
|
||||
assert.isFalse(button.focused);
|
||||
assert.isFalse(ink._animating);
|
||||
assert.equal(ink.ripples.length, 0);
|
||||
assert.isFalse(button.hasRipple());
|
||||
});
|
||||
|
||||
test('receives focus', function() {
|
||||
MockInteractions.focus(button);
|
||||
|
||||
assert.isTrue(button.focused);
|
||||
assert.isTrue(ink._animating);
|
||||
assert.equal(ink.ripples.length, 1);
|
||||
assert.isTrue(button.hasRipple());
|
||||
});
|
||||
|
||||
});
|
||||
|
|
82
dashboard-ui/bower_components/paper-behaviors/test/paper-ripple-behavior.html
vendored
Normal file
82
dashboard-ui/bower_components/paper-behaviors/test/paper-ripple-behavior.html
vendored
Normal file
|
@ -0,0 +1,82 @@
|
|||
<!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
|
||||
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>paper-ripple-behavior</title>
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
<script src="../../iron-test-helpers/mock-interactions.js"></script>
|
||||
|
||||
<link rel="import" href="../../polymer/polymer.html">
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="../../iron-behaviors/iron-button-state.html">
|
||||
<link rel="import" href="../paper-ripple-behavior.html">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<dom-module id="test-ripple">
|
||||
<template>
|
||||
</template>
|
||||
<script>
|
||||
HTMLImports.whenReady(function() {
|
||||
Polymer({
|
||||
is: 'test-ripple',
|
||||
behaviors: [
|
||||
Polymer.IronButtonState,
|
||||
Polymer.IronControlState,
|
||||
Polymer.PaperRippleBehavior
|
||||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
||||
|
||||
<test-fixture id="basic">
|
||||
<template>
|
||||
<test-ripple></test-ripple>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
suite('PaperRippleBehavior', function() {
|
||||
var ripple;
|
||||
|
||||
setup(function() {
|
||||
ripple = fixture('basic');
|
||||
});
|
||||
|
||||
test('no ripple at startup', function() {
|
||||
assert.isFalse(ripple.hasRipple());
|
||||
});
|
||||
|
||||
test('calling getRipple returns ripple', function() {
|
||||
assert.ok(ripple.getRipple());
|
||||
});
|
||||
|
||||
test('focus generates ripple', function() {
|
||||
MockInteractions.focus(ripple);
|
||||
assert.ok(ripple.hasRipple());
|
||||
});
|
||||
|
||||
test('down generates ripple', function() {
|
||||
MockInteractions.down(ripple);
|
||||
assert.ok(ripple.hasRipple());
|
||||
MockInteractions.up(ripple);
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -9,7 +9,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
-->
|
||||
|
||||
<link rel="import" href="../../polymer/polymer.html">
|
||||
<link rel="import" href="../paper-inky-focus-behavior.html">
|
||||
<link rel="import" href="../paper-checked-element-behavior.html">
|
||||
<link rel="import" href="../../paper-ripple/paper-ripple.html">
|
||||
|
||||
<dom-module id="test-radio-button">
|
||||
|
@ -35,7 +35,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
is: 'test-radio-button',
|
||||
|
||||
behaviors: [
|
||||
Polymer.PaperInkyFocusBehavior
|
||||
Polymer.PaperCheckedElementBehavior
|
||||
]
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue