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
e1d75fd9c2
commit
aaeb444675
22 changed files with 253 additions and 90 deletions
|
@ -16,15 +16,14 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.1.51",
|
||||
"_release": "1.1.51",
|
||||
"version": "1.1.52",
|
||||
"_release": "1.1.52",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.1.51",
|
||||
"commit": "b118029cf5077fc940b3a651054357cbd4f7d04e"
|
||||
"tag": "1.1.52",
|
||||
"commit": "e3d1b76fb2c7820d5584d2f3f97fed687a0f9ae2"
|
||||
},
|
||||
"_source": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
|
||||
"_target": "^1.1.51",
|
||||
"_originalSource": "emby-apiclient",
|
||||
"_direct": true
|
||||
"_originalSource": "emby-apiclient"
|
||||
}
|
|
@ -215,7 +215,7 @@
|
|||
return connectUser;
|
||||
};
|
||||
|
||||
var minServerVersion = '3.0.5781';
|
||||
var minServerVersion = '3.0.5782';
|
||||
self.minServerVersion = function (val) {
|
||||
|
||||
if (val) {
|
||||
|
|
|
@ -16,12 +16,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.2.34",
|
||||
"_release": "1.2.34",
|
||||
"version": "1.2.35",
|
||||
"_release": "1.2.35",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.2.34",
|
||||
"commit": "f8d7590edf6f17060cfa04a3f6359ca36aa9789e"
|
||||
"tag": "1.2.35",
|
||||
"commit": "7fe2a2677888e953d429ea985a8690af179faa06"
|
||||
},
|
||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||
"_target": "^1.2.0",
|
||||
|
|
|
@ -226,9 +226,10 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
|||
|
||||
return getSwiperSlideHtmlFromSlide({
|
||||
imageUrl: getImgUrl(item),
|
||||
originalImage: getImgUrl(item, true)
|
||||
originalImage: getImgUrl(item, true),
|
||||
//title: item.Name,
|
||||
//description: item.Overview
|
||||
Id: item.Id
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -253,7 +254,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
|||
function getSwiperSlideHtmlFromSlide(item) {
|
||||
|
||||
var html = '';
|
||||
html += '<div class="swiper-slide" data-original="' + item.originalImage + '">';
|
||||
html += '<div class="swiper-slide" data-original="' + item.originalImage + '" data-itemid="' + item.Id + '">';
|
||||
html += '<img data-src="' + item.imageUrl + '" class="swiper-lazy">';
|
||||
html += '<paper-spinner></paper-spinner>';
|
||||
if (item.title || item.subtitle) {
|
||||
|
@ -304,6 +305,16 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
|||
}
|
||||
}
|
||||
|
||||
function getCurrentItemId() {
|
||||
|
||||
|
||||
if (swiperInstance) {
|
||||
return document.querySelector('.swiper-slide-active').getAttribute('data-itemid');
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function getCurrentImageUrl() {
|
||||
|
||||
|
||||
|
@ -317,11 +328,13 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
|||
function download() {
|
||||
|
||||
var url = getCurrentImageUrl();
|
||||
|
||||
var itemId = getCurrentItemId();
|
||||
alert(itemId);
|
||||
require(['fileDownloader'], function (fileDownloader) {
|
||||
fileDownloader.download([
|
||||
{
|
||||
url: url
|
||||
url: url,
|
||||
itemId: itemId
|
||||
}]);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
"package.json"
|
||||
],
|
||||
"homepage": "https://github.com/hammerjs/hammer.js",
|
||||
"version": "2.0.6",
|
||||
"_release": "2.0.6",
|
||||
"version": "2.0.7",
|
||||
"_release": "2.0.7",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v2.0.6",
|
||||
"commit": "05f0872c6130daf537bad27a393310cd5833c9a1"
|
||||
"tag": "v2.0.7",
|
||||
"commit": "f2e4c826df0117c5c927618a1b335c20681e6978"
|
||||
},
|
||||
"_source": "git://github.com/hammerjs/hammer.js.git",
|
||||
"_source": "https://github.com/hammerjs/hammer.js.git",
|
||||
"_target": "~2.0.4",
|
||||
"_originalSource": "hammer.js"
|
||||
}
|
70
dashboard-ui/bower_components/hammerjs/hammer.js
vendored
70
dashboard-ui/bower_components/hammerjs/hammer.js
vendored
|
@ -1,7 +1,7 @@
|
|||
/*! Hammer.JS - v2.0.6 - 2015-12-23
|
||||
/*! Hammer.JS - v2.0.6 - 2016-04-21
|
||||
* http://hammerjs.github.io/
|
||||
*
|
||||
* Copyright (c) 2015 Jorik Tangelder;
|
||||
* Copyright (c) 2016 Jorik Tangelder;
|
||||
* Licensed under the license */
|
||||
(function(window, document, exportName, undefined) {
|
||||
'use strict';
|
||||
|
@ -130,7 +130,7 @@ if (typeof Object.assign !== 'function') {
|
|||
* means that properties in dest will be overwritten by the ones in src.
|
||||
* @param {Object} dest
|
||||
* @param {Object} src
|
||||
* @param {Boolean=false} [merge]
|
||||
* @param {Boolean} [merge=false]
|
||||
* @returns {Object} dest
|
||||
*/
|
||||
var extend = deprecate(function extend(dest, src, merge) {
|
||||
|
@ -791,7 +791,6 @@ function MouseInput() {
|
|||
this.evEl = MOUSE_ELEMENT_EVENTS;
|
||||
this.evWin = MOUSE_WINDOW_EVENTS;
|
||||
|
||||
this.allow = true; // used by Input.TouchMouse to disable mouse events
|
||||
this.pressed = false; // mousedown state
|
||||
|
||||
Input.apply(this, arguments);
|
||||
|
@ -814,8 +813,8 @@ inherit(MouseInput, Input, {
|
|||
eventType = INPUT_END;
|
||||
}
|
||||
|
||||
// mouse must be down, and mouse events are allowed (see the TouchMouse input)
|
||||
if (!this.pressed || !this.allow) {
|
||||
// mouse must be down
|
||||
if (!this.pressed) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1098,12 +1097,19 @@ function getTouches(ev, type) {
|
|||
* @constructor
|
||||
* @extends Input
|
||||
*/
|
||||
|
||||
var DEDUP_TIMEOUT = 2500;
|
||||
var DEDUP_DISTANCE = 25;
|
||||
|
||||
function TouchMouseInput() {
|
||||
Input.apply(this, arguments);
|
||||
|
||||
var handler = bindFn(this.handler, this);
|
||||
this.touch = new TouchInput(this.manager, handler);
|
||||
this.mouse = new MouseInput(this.manager, handler);
|
||||
|
||||
this.primaryTouch = null;
|
||||
this.lastTouches = [];
|
||||
}
|
||||
|
||||
inherit(TouchMouseInput, Input, {
|
||||
|
@ -1117,17 +1123,15 @@ inherit(TouchMouseInput, Input, {
|
|||
var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
|
||||
isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
|
||||
|
||||
// when we're in a touch event, so block all upcoming mouse events
|
||||
// most mobile browser also emit mouseevents, right after touchstart
|
||||
if (isTouch) {
|
||||
this.mouse.allow = false;
|
||||
} else if (isMouse && !this.mouse.allow) {
|
||||
if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {
|
||||
return;
|
||||
}
|
||||
|
||||
// reset the allowMouse when we're done
|
||||
if (inputEvent & (INPUT_END | INPUT_CANCEL)) {
|
||||
this.mouse.allow = true;
|
||||
// when we're in a touch event, record touches to de-dupe synthetic mouse event
|
||||
if (isTouch) {
|
||||
recordTouches.call(this, inputEvent, inputData);
|
||||
} else if (isMouse && isSyntheticEvent.call(this, inputData)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.callback(manager, inputEvent, inputData);
|
||||
|
@ -1142,6 +1146,44 @@ inherit(TouchMouseInput, Input, {
|
|||
}
|
||||
});
|
||||
|
||||
function recordTouches(eventType, eventData) {
|
||||
if (eventType & INPUT_START) {
|
||||
this.primaryTouch = eventData.changedPointers[0].identifier;
|
||||
setLastTouch.call(this, eventData);
|
||||
} else if (eventType & (INPUT_END | INPUT_CANCEL)) {
|
||||
setLastTouch.call(this, eventData);
|
||||
}
|
||||
}
|
||||
|
||||
function setLastTouch(eventData) {
|
||||
var touch = eventData.changedPointers[0];
|
||||
|
||||
if (touch.identifier === this.primaryTouch) {
|
||||
var lastTouch = {x: touch.clientX, y: touch.clientY};
|
||||
this.lastTouches.push(lastTouch);
|
||||
var lts = this.lastTouches;
|
||||
var removeLastTouch = function() {
|
||||
var i = lts.indexOf(lastTouch);
|
||||
if (i > -1) {
|
||||
lts.splice(i, 1);
|
||||
}
|
||||
};
|
||||
setTimeout(removeLastTouch, DEDUP_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
function isSyntheticEvent(eventData) {
|
||||
var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY;
|
||||
for (var i = 0; i < this.lastTouches.length; i++) {
|
||||
var t = this.lastTouches[i];
|
||||
var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);
|
||||
if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
|
||||
var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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"
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-location",
|
||||
"version": "0.8.1",
|
||||
"version": "0.8.2",
|
||||
"description": "Bidirectional data binding into the page's URL.",
|
||||
"private": true,
|
||||
"authors": [
|
||||
|
@ -11,7 +11,10 @@
|
|||
"polymer",
|
||||
"routing"
|
||||
],
|
||||
"main": "iron-location.html",
|
||||
"main": [
|
||||
"iron-location.html",
|
||||
"iron-query-params.html"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-location.git"
|
||||
|
@ -31,13 +34,14 @@
|
|||
"paper-styles": "polymerelements/paper-styles#^1.0.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.2.3"
|
||||
},
|
||||
"_release": "0.8.1",
|
||||
"_release": "0.8.2",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v0.8.1",
|
||||
"commit": "fe42515f03ff4b3397dedf1c0810f1667f460172"
|
||||
"tag": "v0.8.2",
|
||||
"commit": "9ab0b3bf4b30e00d1f80dcb1cf9e00bd17cce4a5"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-location.git",
|
||||
"_target": "^0.8.0",
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
language: node_js
|
||||
sudo: false
|
||||
sudo: required
|
||||
node_js: stable
|
||||
addons:
|
||||
firefox: latest
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- google-chrome-stable
|
||||
- g++-4.8
|
||||
sauce_connect: true
|
||||
before_script:
|
||||
- npm install -g bower polylint web-component-tester
|
||||
|
@ -22,4 +20,4 @@ env:
|
|||
global:
|
||||
- secure: GQ+cUlta7BWa8Gq4YXrBStPzwRpHT2QG79T4pbDTz2Zs1RvT0GYQaEUksPQnsNCwnTF8ondXhUfMxHcC/r8p7YTCt2hSJSsKkx0lMertsjbKW38ZG28liaAN8msYGb9hnTs4qxhpVEX1pZtOI13RKBU85dw+jKbtxKDX/jVrMn42XCMhEmTeLxM4z8dW5nBu6LW6F3nwABQIUfdc/3OeIYG+2n+84zkXIsX1BFeejq28E6fYJAoMJgqfugLPgPu4IEVCWZJwYl2SgdXwxAcJ2auPph5GJ3DLd0fRRD1TZ94/u0A+eJcQ0OPiPu8hLpQNXOkCgAnO5jkpTCDERNQnB4nY8VfZeZdf1RLAB4VmxzOAbJwJcnqGrh89H6RhKKXyhcuFCgFACYfkzncBCs+co5KwVcwLq88cDOUbnmo3DlwQWpkfusvKy/ZrMrFrX1zycJWN4u8rDsIH4ELasSQh/J3OIa9l2mKfL/OEvqCmpv/ZLGlOVSvNLpr4U7vTVdZBP6C9rtwVXX7VzrClttiidHfoxztAMrNh2GBMjNH9n3FuWMoA/OSoxQGc7RreTsuzdniw3iJYUHIeG08R9bqRtSVA71AlQrbqUaHR+WM7rf7GUx6xG0uDop5vH0RDkE0Nld1W8XuVhHQUg3y3fd4AHJAQVmM7Zsfa3AY1gSr3hV0=
|
||||
- secure: He0JAbtg9jFzuEBRHQdFWHJ33uueY/9Hxq4NB5PCAI1Z9ebIiTs73ofdNy6e+ftBqlQnBuhoKLfIpuD8Qj2kSdLHQvg1s6ojvNDmAvau1ZINCJRgOSKbGC0TvCVx9rT9Kqc83eqKvKDzr/rcpaIArgMYJzBrSG0D2Kn4luUQnWkKfo1knn17ytJFCvzqQvPWZTIZ6beJ7MRKXRU093a4wYMsKIxQHH65T4Ypj+RBsgv6Xnidjb8qZbNsEwaeOwExfsh30WUo/hSygRi2CP3KSRSc/vsMgSrGpFghZpnhjeDJAGTiDzCTxpJkAkHXereJT4agsWErcgSrRTaxi5G6f18o56pRS+I61BC5DuGGwSL7hOHWSC8pGzkwVFyz31MB2ll0HO3iQHMmcSjY37+G7toEP/vJ/UHm6SZoQq36HGJea7Ycv/2mk4HAHcVEDxhYG42bXXflxevFeqAkVUI7SxSaQpQuZF76/4th4uKFmAHPvRVj5yx8OWil9Lt6cG8DIEZaxXdJVueGgiODmmul7lAd5osO/1UCg4CTy1OnmuSJj7ax9LBa6YY2+3uvnBfE7fNUVKmVmVhlLsF0QAdj0LaFoSU0eQFWdReYqBxEvc4gOT3AtEpaAvfZnL11Q6wVyI7kCHhTHrltA4WENPOSA2u7W//WsQfHX3gRdpIVIVI=
|
||||
- CXX=g++-4.8
|
||||
dist: trusty
|
||||
|
|
|
@ -9,7 +9,7 @@ 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
|
||||
jsbin=https://jsbin.com/lebawa/edit?html,output
|
||||
-->
|
||||
# Polymer Elements
|
||||
## Guide for Contributors
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-location",
|
||||
"version": "0.8.1",
|
||||
"version": "0.8.2",
|
||||
"description": "Bidirectional data binding into the page's URL.",
|
||||
"private": true,
|
||||
"authors": [
|
||||
|
@ -11,7 +11,10 @@
|
|||
"polymer",
|
||||
"routing"
|
||||
],
|
||||
"main": "iron-location.html",
|
||||
"main": [
|
||||
"iron-location.html",
|
||||
"iron-query-params.html"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-location.git"
|
||||
|
@ -31,6 +34,7 @@
|
|||
"paper-styles": "polymerelements/paper-styles#^1.0.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.2.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,9 +20,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<link rel="import" href="../../iron-flex-layout/iron-flex-layout.html">
|
||||
<link rel="import" href="../../paper-input/paper-input.html">
|
||||
<link rel="import" href="../../paper-slider/paper-slider.html">
|
||||
<link rel="import" href="../../iron-demo-helpers/url-bar.html">
|
||||
<link rel="stylesheet" href="../../paper-styles/demo.css">
|
||||
</head>
|
||||
<body>
|
||||
<url-bar></url-bar>
|
||||
|
||||
<dom-module id="iron-location-demo">
|
||||
<template>
|
||||
|
|
|
@ -147,8 +147,8 @@ milliseconds.
|
|||
this.listen(window, 'popstate', '_urlChanged');
|
||||
this.listen(/** @type {!HTMLBodyElement} */(document.body), 'click', '_globalOnClick');
|
||||
|
||||
this._urlChanged();
|
||||
this._initialized = true;
|
||||
this._urlChanged();
|
||||
},
|
||||
detached: function() {
|
||||
this.unlisten(window, 'hashchange', '_hashChanged');
|
||||
|
@ -209,14 +209,17 @@ milliseconds.
|
|||
// nothing to do, the URL didn't change
|
||||
return;
|
||||
}
|
||||
// Need to use a full URL in case the containing page has a base URI.
|
||||
var fullNewUrl = new URL(
|
||||
newUrl, window.location.protocol + '//' + window.location.host).href;
|
||||
var now = this._now();
|
||||
var shouldReplace =
|
||||
this._lastChangedAt + this.dwellTime > now;
|
||||
this._lastChangedAt = now;
|
||||
if (shouldReplace) {
|
||||
window.history.replaceState({}, '', newUrl);
|
||||
window.history.replaceState({}, '', fullNewUrl);
|
||||
} else {
|
||||
window.history.pushState({}, '', newUrl);
|
||||
window.history.pushState({}, '', fullNewUrl);
|
||||
}
|
||||
this.fire('location-changed', {}, {node: window});
|
||||
},
|
||||
|
@ -231,7 +234,6 @@ milliseconds.
|
|||
if (!href) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.history.pushState({}, '', href);
|
||||
this.fire('location-changed', {}, {node: window});
|
||||
event.preventDefault();
|
||||
|
@ -304,8 +306,10 @@ milliseconds.
|
|||
!this._urlSpaceRegExp.test(normalizedHref)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return normalizedHref;
|
||||
// Need to use a full URL in case the containing page has a base URI.
|
||||
var fullNormalizedHref = new URL(
|
||||
normalizedHref, window.location.href).href;
|
||||
return fullNormalizedHref;
|
||||
},
|
||||
_makeRegExp: function(urlSpaceRegex) {
|
||||
return RegExp(urlSpaceRegex);
|
||||
|
|
|
@ -18,6 +18,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="../../promise-polyfill/promise-polyfill.html">
|
||||
<link rel="import" href="../iron-location.html">
|
||||
<link rel="import" href="./redirection.html">
|
||||
</head>
|
||||
<body>
|
||||
<test-fixture id='Solo'>
|
||||
|
@ -33,7 +34,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</div>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id='RedirectHash'>
|
||||
<template>
|
||||
<redirect-hash></redirect-hash>
|
||||
</template>
|
||||
</test-fixture>
|
||||
<test-fixture id='RedirectPath'>
|
||||
<template>
|
||||
<redirect-path></redirect-path>
|
||||
</template>
|
||||
</test-fixture>
|
||||
<test-fixture id='RedirectQuery'>
|
||||
<template>
|
||||
<redirect-query></redirect-query>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
'use strict';
|
||||
|
@ -46,15 +61,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
});
|
||||
}
|
||||
|
||||
suite('<iron-location>', function () {
|
||||
var initialUrl;
|
||||
setup(function() {
|
||||
initialUrl = window.location.href;
|
||||
});
|
||||
teardown(function(){
|
||||
window.history.replaceState({}, '', initialUrl);
|
||||
});
|
||||
// A window.history.replaceState wrapper that's smart about baseURI.
|
||||
function replaceState(url) {
|
||||
window.history.replaceState(
|
||||
{}, '', window.location.protocol + '//' + window.location.host + url);
|
||||
}
|
||||
|
||||
/**
|
||||
* We run the iron location tests with a couple different page configurations
|
||||
* (e.g. with and withoug a base URI), so we define the test set as a function
|
||||
* that we call in each of these configurations.
|
||||
*/
|
||||
function ironLocationTests() {
|
||||
suite('when used solo', function() {
|
||||
var urlElem;
|
||||
setup(function() {
|
||||
|
@ -70,7 +88,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
// Changing the hash via normal means changes the urlElem.
|
||||
var anchor = document.createElement('a');
|
||||
anchor.href = '#/wat';
|
||||
var base =
|
||||
window.location.protocol + '//' + window.location.host +
|
||||
window.location.pathname;
|
||||
anchor.href = base + '#/wat';
|
||||
document.body.appendChild(anchor);
|
||||
anchor.click();
|
||||
// In IE10 it appears that the hashchange event is asynchronous.
|
||||
|
@ -88,17 +109,26 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
// Changing the path and sending a custom event on the window changes
|
||||
// the urlElem.
|
||||
window.history.replaceState({}, '', '/baz')
|
||||
replaceState('/baz');
|
||||
window.dispatchEvent(new CustomEvent('location-changed'));
|
||||
expect(urlElem.path).to.be.equal('/baz');
|
||||
});
|
||||
test('assigning to a relative path URL', function() {
|
||||
urlElem.path = '/foo/bar';
|
||||
expect(window.location.pathname).to.be.equal('/foo/bar');
|
||||
|
||||
// A relative path is treated as an absolute one, just with a
|
||||
// missing leading slash.
|
||||
urlElem.path = 'baz';
|
||||
expect(window.location.pathname).to.be.equal('/baz');
|
||||
});
|
||||
test('basic functionality with ?key=value params', function() {
|
||||
// Initialized to the window location's params.
|
||||
expect(urlElem.query).to.be.eq('');
|
||||
|
||||
// Changing location.search and sending a custom event on the window
|
||||
// changes the urlElem.
|
||||
window.history.replaceState({}, '', '/?greeting=hello&target=world');
|
||||
replaceState('/?greeting=hello&target=world');
|
||||
window.dispatchEvent(new CustomEvent('location-changed'));
|
||||
expect(urlElem.query).to.be.equal('greeting=hello&target=world');
|
||||
|
||||
|
@ -134,6 +164,67 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assertHaveSameUrls(urlElem, otherUrlElem);
|
||||
});
|
||||
});
|
||||
|
||||
suite('supports doing synchronous redirection', function() {
|
||||
test('of the hash portion of the URL', function() {
|
||||
expect(window.location.hash).to.be.equal('');
|
||||
var redirector = fixture('RedirectHash');
|
||||
expect(window.location.hash).to.be.equal('#redirectedTo');
|
||||
expect(redirector.hash).to.be.equal('redirectedTo');
|
||||
redirector.hash = 'newHash';
|
||||
expect(window.location.hash).to.be.equal('#redirectedTo');
|
||||
expect(redirector.hash).to.be.equal('redirectedTo');
|
||||
});
|
||||
|
||||
test('of the path portion of the URL', function() {
|
||||
expect(window.location.pathname).to.not.be.equal('/redirectedTo');
|
||||
var redirector = fixture('RedirectPath');
|
||||
expect(window.location.pathname).to.be.equal('/redirectedTo');
|
||||
expect(redirector.path).to.be.equal('/redirectedTo');
|
||||
redirector.path = '/newPath';
|
||||
expect(window.location.pathname).to.be.equal('/redirectedTo');
|
||||
expect(redirector.path).to.be.equal('/redirectedTo');
|
||||
});
|
||||
|
||||
test('of the query portion of the URL', function() {
|
||||
expect(window.location.search).to.be.equal('');
|
||||
var redirector = fixture('RedirectQuery');
|
||||
expect(window.location.search).to.be.equal('?redirectedTo');
|
||||
expect(redirector.query).to.be.equal('redirectedTo');
|
||||
redirector.query = 'newQuery';
|
||||
expect(window.location.search).to.be.equal('?redirectedTo');
|
||||
expect(redirector.query).to.be.equal('redirectedTo');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
suite('<iron-location>', function () {
|
||||
var initialUrl;
|
||||
setup(function() {
|
||||
initialUrl = window.location.href;
|
||||
});
|
||||
teardown(function(){
|
||||
window.history.replaceState({}, '', initialUrl);
|
||||
});
|
||||
|
||||
ironLocationTests();
|
||||
|
||||
suite('with a base URI', function() {
|
||||
var baseElem;
|
||||
setup(function() {
|
||||
expect(document.baseURI).to.be.equal(window.location.href);
|
||||
baseElem = document.createElement('base');
|
||||
var href = 'https://example.com/i/dont/exist/obviously'
|
||||
baseElem.href = href;
|
||||
document.head.appendChild(baseElem);
|
||||
expect(document.baseURI).to.be.equal(href);
|
||||
});
|
||||
teardown(function() {
|
||||
document.head.removeChild(baseElem);
|
||||
});
|
||||
|
||||
ironLocationTests();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -34,14 +34,14 @@
|
|||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/PolymerElements/iron-overlay-behavior",
|
||||
"homepage": "https://github.com/polymerelements/iron-overlay-behavior",
|
||||
"_release": "1.6.3",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.6.3",
|
||||
"commit": "5b331ebaefe3214937b94ba19769154efee46244"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-overlay-behavior.git",
|
||||
"_source": "git://github.com/polymerelements/iron-overlay-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "PolymerElements/iron-overlay-behavior"
|
||||
"_originalSource": "polymerelements/iron-overlay-behavior"
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "neon-animation",
|
||||
"description": "A system for animating Polymer-based web components",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.2",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
|
@ -49,13 +49,13 @@
|
|||
"iron-icons": "PolymerElements/iron-icons#^1.0.0",
|
||||
"paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0"
|
||||
},
|
||||
"_release": "1.2.1",
|
||||
"_release": "1.2.2",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.2.1",
|
||||
"commit": "de3198eb64f1afbc05973fc8a7841a3b0566977e"
|
||||
"tag": "v1.2.2",
|
||||
"commit": "67b614a9261c84be12293f1105bafc158a2f443c"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/neon-animation.git",
|
||||
"_source": "git://github.com/polymerelements/neon-animation.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "PolymerElements/neon-animation"
|
||||
"_originalSource": "polymerelements/neon-animation"
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "neon-animation",
|
||||
"description": "A system for animating Polymer-based web components",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.2",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
|
|
|
@ -93,7 +93,11 @@ animations to be run when switching to or switching out of the page.
|
|||
|
||||
_onIronSelect: function(event) {
|
||||
var selectedPage = event.detail.item;
|
||||
if (!selectedPage) return;
|
||||
|
||||
// Only consider child elements.
|
||||
if (this.items.indexOf(selectedPage) < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var oldPage = this._valueToItem(this._prevSelected) || false;
|
||||
this._prevSelected = this.selected;
|
||||
|
|
|
@ -18,7 +18,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
'neon-animated-pages.html',
|
||||
'neon-animated-pages.html?dom=shadow',
|
||||
'neon-animated-pages-lazy.html',
|
||||
'neon-animated-pages-lazy.html?dom=shadow'
|
||||
'neon-animated-pages-lazy.html?dom=shadow',
|
||||
'neon-animated-pages-descendant-selection.html',
|
||||
'neon-animated-pages-descendant-selection.html?dom=shadow',
|
||||
]);
|
||||
</script>
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
"tag": "v1.0.11",
|
||||
"commit": "e3c1ab0c72905b58fb4d9adc2921ea73b5c085a5"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/paper-behaviors.git",
|
||||
"_source": "git://github.com/PolymerElements/paper-behaviors.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "polymerelements/paper-behaviors"
|
||||
"_originalSource": "PolymerElements/paper-behaviors"
|
||||
}
|
|
@ -32,14 +32,14 @@
|
|||
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0"
|
||||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/polymerelements/paper-ripple",
|
||||
"homepage": "https://github.com/PolymerElements/paper-ripple",
|
||||
"_release": "1.0.5",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.5",
|
||||
"commit": "d72e7a9a8ab518b901ed18dde492df3b87a93be5"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/paper-ripple.git",
|
||||
"_source": "git://github.com/PolymerElements/paper-ripple.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "polymerelements/paper-ripple"
|
||||
"_originalSource": "PolymerElements/paper-ripple"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue