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
9254ff721d
commit
3197c48232
162 changed files with 902 additions and 9728 deletions
|
@ -16,12 +16,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.1.64",
|
||||
"_release": "1.1.64",
|
||||
"version": "1.1.65",
|
||||
"_release": "1.1.65",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.1.64",
|
||||
"commit": "a1d00ddc6a767b00a588729b13c8202b99b1eadb"
|
||||
"tag": "1.1.65",
|
||||
"commit": "7ba3ab66a503b3cf099ff63a7dc923490401c0bc"
|
||||
},
|
||||
"_source": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
|
||||
"_target": "^1.1.51",
|
||||
|
|
|
@ -215,7 +215,7 @@
|
|||
return connectUser;
|
||||
};
|
||||
|
||||
var minServerVersion = '3.0.5882';
|
||||
var minServerVersion = '3.0.5911';
|
||||
self.minServerVersion = function (val) {
|
||||
|
||||
if (val) {
|
||||
|
|
|
@ -15,12 +15,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.4.78",
|
||||
"_release": "1.4.78",
|
||||
"version": "1.4.80",
|
||||
"_release": "1.4.80",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.4.78",
|
||||
"commit": "33c9381ec8872ebd87e46def5a2b86dcbf952f0d"
|
||||
"tag": "1.4.80",
|
||||
"commit": "a959ba5d3e78c15e700002a399450365bc6b9328"
|
||||
},
|
||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||
"_target": "^1.2.0",
|
||||
|
|
|
@ -134,7 +134,7 @@
|
|||
|
||||
browser.xboxOne = userAgent.toLowerCase().indexOf('xbox') != -1;
|
||||
browser.animate = document.documentElement.animate != null;
|
||||
browser.tizen = userAgent.toLowerCase().indexOf('tizen') != -1;
|
||||
browser.tizen = userAgent.toLowerCase().indexOf('tizen') != -1 || userAgent.toLowerCase().indexOf('smarthub') != -1;
|
||||
browser.web0s = userAgent.toLowerCase().indexOf('Web0S'.toLowerCase()) != -1;
|
||||
|
||||
browser.tv = isTv();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
button.listItem {
|
||||
background: transparent;
|
||||
border: 0 !important;
|
||||
border-bottom: 1px solid #2a2a2a !important;
|
||||
cursor: pointer;
|
||||
outline: none !important;
|
||||
color: inherit;
|
||||
|
@ -16,6 +17,7 @@ button.listItem {
|
|||
text-align: left;
|
||||
padding: 0 1em !important;
|
||||
line-height: 170%;
|
||||
border-bottom: 1px solid #2a2a2a;
|
||||
}
|
||||
|
||||
.listItem.largeImage {
|
||||
|
@ -33,7 +35,7 @@ button.listItem {
|
|||
|
||||
.listItemBody {
|
||||
flex-grow: 1;
|
||||
padding: 0 1.15em;
|
||||
padding: 0 1em;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
flex-direction: column;
|
||||
|
@ -82,6 +84,7 @@ button.listItem {
|
|||
background-size: contain;
|
||||
flex-shrink: 0;
|
||||
margin-left: -.75em;
|
||||
background-position: center center;
|
||||
}
|
||||
|
||||
.listItemIcon {
|
||||
|
@ -133,10 +136,17 @@ button.listItem {
|
|||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.listItemMediaInfo {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.listItemMediaInfo > * {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@supports (display: flex) {
|
||||
|
||||
.listItem, .listItemBody {
|
||||
.listItem, .listItemBody, .listItemMediaInfo {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,116 @@
|
|||
define(['itemHelper', 'mediaInfo', 'indicators', 'css!./listview'], function (itemHelper, mediaInfo, indicators) {
|
||||
define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutManager', 'userdataButtons', 'css!./listview'], function (itemHelper, mediaInfo, indicators, connectionManager, layoutManager, userdataButtons) {
|
||||
|
||||
function getIndex(item, options) {
|
||||
|
||||
if (options.index == 'disc') {
|
||||
|
||||
return item.ParentIndexNumber == null ? '' : Globalize.translate('sharedcomponents#ValueDiscNumber', item.ParentIndexNumber);
|
||||
}
|
||||
|
||||
var sortBy = (options.sortBy || '').toLowerCase();
|
||||
var code, name;
|
||||
|
||||
if (sortBy.indexOf('sortname') == 0) {
|
||||
|
||||
if (item.Type == 'Episode') return '';
|
||||
|
||||
// SortName
|
||||
name = (item.SortName || item.Name || '?')[0].toUpperCase();
|
||||
|
||||
code = name.charCodeAt(0);
|
||||
if (code < 65 || code > 90) {
|
||||
return '#';
|
||||
}
|
||||
|
||||
return name.toUpperCase();
|
||||
}
|
||||
if (sortBy.indexOf('officialrating') == 0) {
|
||||
|
||||
return item.OfficialRating || globalize.translate('sharedcomponents#Unrated');
|
||||
}
|
||||
if (sortBy.indexOf('communityrating') == 0) {
|
||||
|
||||
if (item.CommunityRating == null) {
|
||||
return globalize.translate('sharedcomponents#Unrated');
|
||||
}
|
||||
|
||||
return Math.floor(item.CommunityRating);
|
||||
}
|
||||
if (sortBy.indexOf('criticrating') == 0) {
|
||||
|
||||
if (item.CriticRating == null) {
|
||||
return globalize.translate('sharedcomponents#Unrated');
|
||||
}
|
||||
|
||||
return Math.floor(item.CriticRating);
|
||||
}
|
||||
if (sortBy.indexOf('metascore') == 0) {
|
||||
|
||||
if (item.Metascore == null) {
|
||||
return globalize.translate('sharedcomponents#Unrated');
|
||||
}
|
||||
|
||||
return Math.floor(item.Metascore);
|
||||
}
|
||||
if (sortBy.indexOf('albumartist') == 0) {
|
||||
|
||||
// SortName
|
||||
if (!item.AlbumArtist) return '';
|
||||
|
||||
name = item.AlbumArtist[0].toUpperCase();
|
||||
|
||||
code = name.charCodeAt(0);
|
||||
if (code < 65 || code > 90) {
|
||||
return '#';
|
||||
}
|
||||
|
||||
return name.toUpperCase();
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function getImageUrl(item, width) {
|
||||
|
||||
var apiClient = connectionManager.getApiClient(item.ServerId);
|
||||
|
||||
var options = {
|
||||
width: width,
|
||||
type: "Primary"
|
||||
};
|
||||
|
||||
if (item.ImageTags && item.ImageTags['Primary']) {
|
||||
|
||||
options.tag = item.ImageTags['Primary'];
|
||||
return apiClient.getScaledImageUrl(item.Id, options);
|
||||
}
|
||||
|
||||
if (item.AlbumId && item.AlbumPrimaryImageTag) {
|
||||
|
||||
options.tag = item.AlbumPrimaryImageTag;
|
||||
return apiClient.getScaledImageUrl(item.AlbumId, options);
|
||||
}
|
||||
|
||||
else if (item.SeriesId && item.SeriesPrimaryImageTag) {
|
||||
|
||||
options.tag = item.SeriesPrimaryImageTag;
|
||||
return apiClient.getScaledImageUrl(item.SeriesId, options);
|
||||
|
||||
}
|
||||
else if (item.ParentPrimaryImageTag) {
|
||||
|
||||
options.tag = item.ParentPrimaryImageTag;
|
||||
return apiClient.getScaledImageUrl(item.ParentPrimaryImageItemId, options);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function getListViewHtml(items, options) {
|
||||
|
||||
var outerHtml = "";
|
||||
if (arguments.length == 1) {
|
||||
options = items;
|
||||
items = options.items;
|
||||
}
|
||||
|
||||
var index = 0;
|
||||
var groupTitle = '';
|
||||
|
@ -11,10 +119,36 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'css!./listview'], function (it
|
|||
var isLargeStyle = options.imageSize == 'large';
|
||||
var enableOverview = options.enableOverview;
|
||||
|
||||
outerHtml += items.map(function (item) {
|
||||
var clickEntireItem = layoutManager.tv ? true : false;
|
||||
var outerTagName = clickEntireItem ? 'button' : 'div';
|
||||
|
||||
return items.map(function (item) {
|
||||
|
||||
var html = '';
|
||||
|
||||
//if (options.showIndex !== false) {
|
||||
|
||||
// var itemGroupTitle = LibraryBrowser.getListViewIndex(item, options);
|
||||
|
||||
// if (itemGroupTitle != groupTitle) {
|
||||
|
||||
// outerHtml += '</div>';
|
||||
|
||||
// if (index == 0) {
|
||||
// html += '<h1>';
|
||||
// }
|
||||
// else {
|
||||
// html += '<h1 style="margin-top:2em;">';
|
||||
// }
|
||||
// html += itemGroupTitle;
|
||||
// html += '</h1>';
|
||||
|
||||
// html += '<div class="paperList itemsListview">';
|
||||
|
||||
// groupTitle = itemGroupTitle;
|
||||
// }
|
||||
//}
|
||||
|
||||
var cssClass = "itemAction listItem";
|
||||
|
||||
var downloadWidth = 80;
|
||||
|
@ -24,19 +158,9 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'css!./listview'], function (it
|
|||
downloadWidth = 500;
|
||||
}
|
||||
|
||||
html += '<button class="' + cssClass + '" data-index="' + index + '" data-action="' + action + '" data-isfolder="' + item.IsFolder + '" data-id="' + item.Id + '" data-serverid="' + item.ServerId + '" data-type="' + item.Type + '">';
|
||||
html += '<' + outerTagName + ' class="' + cssClass + '" data-index="' + index + '" data-action="' + action + '" data-isfolder="' + item.IsFolder + '" data-id="' + item.Id + '" data-serverid="' + item.ServerId + '" data-type="' + item.Type + '">';
|
||||
|
||||
var imgUrl = Emby.Models.imageUrl(item, {
|
||||
width: downloadWidth,
|
||||
type: "Primary"
|
||||
});
|
||||
|
||||
if (!imgUrl) {
|
||||
imgUrl = Emby.Models.thumbImageUrl(item, {
|
||||
width: downloadWidth,
|
||||
type: "Thumb"
|
||||
});
|
||||
}
|
||||
var imgUrl = getImageUrl(item, downloadWidth);
|
||||
|
||||
if (imgUrl) {
|
||||
html += '<div class="listItemImage lazy" data-src="' + imgUrl + '" item-icon>';
|
||||
|
@ -122,18 +246,23 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'css!./listview'], function (it
|
|||
|
||||
html += '</div>';
|
||||
|
||||
if (!clickEntireItem) {
|
||||
html += '<button is="paper-icon-button-light" class="listviewMenuButton autoSize"><i class="md-icon"></i></button>';
|
||||
html += '<span class="listViewUserDataButtons">';
|
||||
html += userdataButtons.getIconsHtml(item);
|
||||
html += '</span>';
|
||||
}
|
||||
|
||||
if (options.enableSideMediaInfo) {
|
||||
html += '<div class="secondary listItemMediaInfo">' + mediaInfo.getPrimaryMediaInfoHtml(item) + '</div>';
|
||||
}
|
||||
|
||||
html += '</button>';
|
||||
html += '</' + outerTagName + '>';
|
||||
|
||||
index++;
|
||||
return html;
|
||||
|
||||
}).join('');
|
||||
|
||||
return outerHtml;
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
188
dashboard-ui/bower_components/emby-webcomponents/userdatabuttons/userdatabuttons.js
vendored
Normal file
188
dashboard-ui/bower_components/emby-webcomponents/userdatabuttons/userdatabuttons.js
vendored
Normal file
|
@ -0,0 +1,188 @@
|
|||
define(['connectionManager', 'globalize', 'paper-icon-button-light', 'material-icons', 'emby-button'], function (connectionManager, globalize) {
|
||||
|
||||
function getUserDataButtonHtml(method, itemId, iconCssClass, icon, tooltip, style) {
|
||||
|
||||
var is = style == 'fab' ? 'emby-button' : 'paper-icon-button-light';
|
||||
var className = style == 'fab' ? 'autoSize fab' : 'autoSize';
|
||||
|
||||
className += ' ' + iconCssClass;
|
||||
|
||||
return '<button title="' + tooltip + '" data-itemid="' + itemId + '" is="' + is + '" class="' + className + '" onclick="UserDataButtons.' + method + '(this);return false;">\
|
||||
<i class="md-icon">' + icon + '</i>\
|
||||
</button>';
|
||||
}
|
||||
|
||||
function fill(options) {
|
||||
|
||||
var html = getIconsHtml(options.item, options.includePlayed, options.buttonClass, options.style);
|
||||
|
||||
options.element.innerHTML = html;
|
||||
}
|
||||
|
||||
function getIconsHtml(item, includePlayed, cssClass, style) {
|
||||
|
||||
var html = '';
|
||||
|
||||
var userData = item.UserData || {};
|
||||
|
||||
var itemId = item.Id;
|
||||
|
||||
var btnCssClass = "btnUserData";
|
||||
|
||||
if (cssClass) {
|
||||
btnCssClass += " " + cssClass;
|
||||
}
|
||||
|
||||
if (includePlayed !== false) {
|
||||
var tooltipPlayed = globalize.translate('sharedcomponents#Played');
|
||||
|
||||
if (item.MediaType == 'Video' || item.Type == 'Series' || item.Type == 'Season' || item.Type == 'BoxSet' || item.Type == 'Playlist') {
|
||||
if (item.Type != 'TvChannel') {
|
||||
if (userData.Played) {
|
||||
html += getUserDataButtonHtml('markPlayed', itemId, btnCssClass + ' btnUserDataOn', 'check', tooltipPlayed, style);
|
||||
} else {
|
||||
html += getUserDataButtonHtml('markPlayed', itemId, btnCssClass, 'check', tooltipPlayed, style);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var tooltipLike = globalize.translate('sharedcomponents#Like');
|
||||
var tooltipDislike = globalize.translate('sharedcomponents#Dislike');
|
||||
|
||||
//if (typeof userData.Likes == "undefined") {
|
||||
// html += getUserDataButtonHtml('markDislike', itemId, btnCssClass + ' btnUserData btnDislike', 'thumb-down', tooltipDislike);
|
||||
// html += getUserDataButtonHtml('markLike', itemId, btnCssClass + ' btnUserData btnLike', 'thumb-up', tooltipLike);
|
||||
//}
|
||||
//else if (userData.Likes) {
|
||||
// html += getUserDataButtonHtml('markDislike', itemId, btnCssClass + ' btnUserData btnDislike', 'thumb-down', tooltipDislike);
|
||||
// html += getUserDataButtonHtml('markLike', itemId, btnCssClass + ' btnUserData btnLike btnUserDataOn', 'thumb-up', tooltipLike);
|
||||
//}
|
||||
//else {
|
||||
// html += getUserDataButtonHtml('markDislike', itemId, btnCssClass + ' btnUserData btnDislike btnUserDataOn', 'thumb-down', tooltipDislike);
|
||||
// html += getUserDataButtonHtml('markLike', itemId, btnCssClass + ' btnUserData btnLike', 'thumb-up', tooltipLike);
|
||||
//}
|
||||
|
||||
var tooltipFavorite = globalize.translate('sharedcomponents#Favorite');
|
||||
if (userData.IsFavorite) {
|
||||
|
||||
html += getUserDataButtonHtml('markFavorite', itemId, btnCssClass + ' btnUserData btnUserDataOn', 'favorite', tooltipFavorite, style);
|
||||
} else {
|
||||
html += getUserDataButtonHtml('markFavorite', itemId, btnCssClass + ' btnUserData', 'favorite', tooltipFavorite, style);
|
||||
}
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function markFavorite(link) {
|
||||
|
||||
var id = link.getAttribute('data-itemid');
|
||||
|
||||
var markAsFavorite = !link.classList.contains('btnUserDataOn');
|
||||
|
||||
favorite(id, markAsFavorite);
|
||||
|
||||
if (markAsFavorite) {
|
||||
link.classList.add('btnUserDataOn');
|
||||
} else {
|
||||
link.classList.remove('btnUserDataOn');
|
||||
}
|
||||
}
|
||||
|
||||
function markLike(link) {
|
||||
|
||||
var id = link.getAttribute('data-itemid');
|
||||
|
||||
if (!link.classList.contains('btnUserDataOn')) {
|
||||
|
||||
likes(id, true);
|
||||
|
||||
link.classList.add('btnUserDataOn');
|
||||
|
||||
} else {
|
||||
|
||||
clearLike(id);
|
||||
|
||||
link.classList.remove('btnUserDataOn');
|
||||
}
|
||||
|
||||
link.parentNode.querySelector('.btnDislike').classList.remove('btnUserDataOn');
|
||||
}
|
||||
|
||||
function markDislike(link) {
|
||||
|
||||
var id = link.getAttribute('data-itemid');
|
||||
|
||||
if (!link.classList.contains('btnUserDataOn')) {
|
||||
|
||||
likes(id, false);
|
||||
|
||||
link.classList.add('btnUserDataOn');
|
||||
|
||||
} else {
|
||||
|
||||
clearLike(id);
|
||||
|
||||
link.classList.remove('btnUserDataOn');
|
||||
}
|
||||
|
||||
link.parentNode.querySelector('.btnLike').classList.remove('btnUserDataOn');
|
||||
}
|
||||
|
||||
function markPlayed(link) {
|
||||
|
||||
var id = link.getAttribute('data-itemid');
|
||||
|
||||
if (!link.classList.contains('btnUserDataOn')) {
|
||||
|
||||
played(id, true);
|
||||
|
||||
link.classList.add('btnUserDataOn');
|
||||
|
||||
} else {
|
||||
|
||||
played(id, false);
|
||||
|
||||
link.classList.remove('btnUserDataOn');
|
||||
}
|
||||
}
|
||||
|
||||
function likes(id, isLiked) {
|
||||
var apiClient = connectionManager.currentApiClient();
|
||||
return apiClient.updateUserItemRating(apiClient.getCurrentUserId(), id, isLiked);
|
||||
}
|
||||
|
||||
function played(id, isPlayed) {
|
||||
var apiClient = connectionManager.currentApiClient();
|
||||
|
||||
var method = isPlayed ? 'markPlayed' : 'markUnplayed';
|
||||
|
||||
return apiClient[method](apiClient.getCurrentUserId(), id, new Date());
|
||||
}
|
||||
|
||||
function favorite(id, isFavorite) {
|
||||
var apiClient = connectionManager.currentApiClient();
|
||||
|
||||
return apiClient.updateFavoriteStatus(apiClient.getCurrentUserId(), id, isFavorite);
|
||||
}
|
||||
|
||||
function clearLike(id) {
|
||||
|
||||
var apiClient = connectionManager.currentApiClient();
|
||||
|
||||
return apiClient.clearUserItemRating(apiClient.getCurrentUserId(), id);
|
||||
}
|
||||
|
||||
window.UserDataButtons = {
|
||||
markPlayed: markPlayed,
|
||||
markDislike: markDislike,
|
||||
markLike: markLike,
|
||||
markFavorite: markFavorite
|
||||
};
|
||||
|
||||
return {
|
||||
fill: fill,
|
||||
getIconsHtml: getIconsHtml
|
||||
};
|
||||
|
||||
});
|
|
@ -150,7 +150,7 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
|
|||
|
||||
return new Promise(function (resolve, reject) {
|
||||
var timings = {
|
||||
duration: 200,
|
||||
duration: 300,
|
||||
iterations: 1,
|
||||
easing: 'ease-out',
|
||||
fill: 'both'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-a11y-announcer",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"description": "A singleton element that simplifies announcing text to screen readers.",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
|
@ -18,7 +18,7 @@
|
|||
"main": "iron-a11y-announcer.html",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"dependencies": {
|
||||
"polymer": "polymer/polymer#^1.0.0"
|
||||
"polymer": "polymer/polymer#^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
|
||||
|
@ -27,15 +27,15 @@
|
|||
"paper-styles": "polymerelements/paper-styles#^1.0.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
"web-component-tester": "polymer/web-component-tester#^3.4.0"
|
||||
"web-component-tester": "^4.0.0"
|
||||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/PolymerElements/iron-a11y-announcer",
|
||||
"_release": "1.0.4",
|
||||
"_release": "1.0.5",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.4",
|
||||
"commit": "5ce3eb8c4282bb53cd72e348858dc6be6b4c50b9"
|
||||
"tag": "v1.0.5",
|
||||
"commit": "2432d39a1693ccd728cbe7eb55810063737d3403"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-a11y-announcer.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!-- Instructions: https://github.com/PolymerElements/iron-scroll-target-behavior/CONTRIBUTING.md#filing-issues -->
|
||||
<!-- Instructions: https://github.com/PolymerElements/iron-a11y-announcer/CONTRIBUTING.md#filing-issues -->
|
||||
### Description
|
||||
<!-- Example: The `paper-foo` element causes the page to turn pink when clicked. -->
|
||||
|
|
@ -1,22 +1,23 @@
|
|||
language: node_js
|
||||
sudo: false
|
||||
sudo: required
|
||||
before_script:
|
||||
- npm install web-component-tester
|
||||
- npm install bower
|
||||
- 'export PATH=$PWD/node_modules/.bin:$PATH'
|
||||
- bower install
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
env:
|
||||
global:
|
||||
- secure: lNcOb1qPO7R65VYIQ6ekoc4I8wg98E/DRdqRMGAWrvr9eZ6lbz4hqwVvgnl05Ukc62lFsEGdaykFdcQ5QG5rDxXxh1Dofl8dfE8ohBZzR9gQ5g9808CVVbV/0kfafAMts/KYGVLAuy+30aU/xA+DQ4oR76E1glZOGoz4FDxUotIFpMyPR77HC1WDuFiF/HUOUgs8zO5v02171URdYG33ywVx6n0j1akCKksQ9Odcxn+VF51xziSuP+Hd+mju4j6xiAsvkc8EhdFMTXBKDHH0LEjP6zVLQ+lA4ePX2YxPAocFUcWFlGsfDwLdbY18zrP9vXK0AqpoU0d3hW1bLdxoH+4Fd8WkFzYB5rjtV0jT8BOWjEK+1g7GBzofZYQs+h9kRUoNQA5m7NNo3dz/NM8NxvDCALscH2kWTEYpzvaX/Gy653psOkKe8MRawa6nqgXreaNEn3dtVqlonz3KpgVLJpgBtLYvQDQ8lczntuBw6BlnCZRZw8wy0hLHIIpld/GbxrH1O13XGpT07CAny10wZYMk9J0OiEuMPd23UNdcEXibNnfDS18UKW64JoILqqBMyl10WY6dOqLt7DAd5eDoKqZ/heU3vXFm9/JcebtUB3NmOG+qkgb1UOChEtzxJFCXa3S3NFsLiHra6CgdV78gHM5WizlT0kldecgrlDtz/tQ=
|
||||
- secure: ig1L3SPuNpnAqzk8wXc8SqprhF7ajVuD1MQa0KfmkCxFZCXSmAHnt9tsuwrkea0J3s3Mmj+UQBI3WX5jsFEAlwNy239uRIUxHTz/tsKznmo5Jf+u/u7jHR4H/x0+kNbA/D56eInlNeR9bwE/72kiWB2ZI9nxHIggNxJrsTK4d+CQC863V763P8sJaBNP7BXq/2igs2/wHgfsF126oKOf0fxMbeBm3tFYB0VBdkLZJvQ+NowZGn/RTvmdAMJZe/UuICf9jTl/YQXp7q3b/hF5h/CMlQckkNoiQZ8FY3yz4yg8eJc2Pe1NjuCYl8YE7nUY+mUX8B/hqB9g05LmKxAdFg1icsq14Rmb54MBa6CsYIPo5ZZNXSeCkiQvfHOOhubnB4lBxDYGSLwFIDwpRtRRkwIzpz/5sul6OP9RR/g0kXnmktFEYbu2/OQk89H2GymOdrIlUrJ9Rat74X4My3DO7I7QnGi/04I7sLxP5PxUShqcjDi5q4rZTXG/ssaLS3O4YvXigy0ZzK6PsKX8jYVTlQdMQHBY5IwYH6reJ5IM0KjJoum95VoZTTKtIAIxOjLnbVu8khwxYDyzFhrfUKkvcULCCrGx7PphBPNV6SN+/0TFNmuabhp1nLb/+lZ61bVFiV5Mfs7DF8WVVMvwhBMw68HqIyts/b5g68e/yjwV6do=
|
||||
node_js: 4
|
||||
- secure: QlyQxWnziNgzWqptOtM0Oq1s/q6YHT/GPuslA31yC0nex7Wi6X9DFoF5rNlDEY0Y6WxCh8xzsZpwXrI9vZypgKoZlAwO1e3RLDsGV0APPrWg66MyImAwlHAJolvJg+ASsLJ8pm9nxMP/xapRamciqUMTUTeZh0V/5SR82BXQCf3zXe+9cMmAFNXBrIg6LDCm77AwW+1vkE/IZAL1oShSBwXEybn9kpYsdCiOGdnvMlChhaeqRlOUXkr3LHPUDtV8hbd2EswmPeHSV+RGdB/UFyRGa4g7gPgqtz7U2FS0/BqT0G2iJlAXGCttJnS6fXwyCriREplYjXzqrX0MeRWHD5vNxAucO/Va1n2tHEmJM3OhIYgO8VDM8S3nRRUDE/ifSjsu1UgBN7b1vml0zWo7rdvpD8fedx6+g4ph390kg5XRFNJZJ03YijfcNVUfnOTEWt9LntGRq5aKPB6RSbEvkuZFjLGHHD/xQu2LfyIjmueIWJNk4JeCNrm3zFPMhBAZfu7WTJPTk3dZ2L+0mty1QbaJ/lyTWIBYbTVBwwHzXKrPbgg5u/9e6DjhT8Zg/eJvmN/+sXAlUqnmTAE9coQ0LIivg6COWPoRDmdGl2uMygiCaLkFAy4sqhjP99Aq5/ekZWXUrTTa4NGw2qnvM4JY9YcEzUC0ZqzM11gj8x8ATi0=
|
||||
- secure: d0wz93AwXyNVmCr33od+TFC51nZgUzcdwHiJWxX0E+msZ8VgYCjj21D6OOZy84O7vYiPFy8vO03dvyqkj1uclEvfu2YlfiEaRxifKaxN6mQx142WjBtdHFjEUfBJR5eqm5qSeGj7aSZzPgerUl6yAkYH5tFldBatevF5Ax98Yr1dCsgpegsLCmBmusPH7tERnBilalcvXKVBfRXrnrkFkVoWroBb04W79aZSTlLGTlpBJCzR9Xe7RiXqnanSQQb1LjyCl55P0NvVVRjwpoVnikRqkIV/jehcNfIiJSC/vetepqqUehD6RdP2T8Nio7YvlLtXnW9vptlKYL2uZjhg23DyhgGW/4ZPaIABWVBqVUBbyaX6GCXo3EMyQcZhi17qCWEKnFGCrorC/4ZM6A0kJ+olOfQxszf9HrAX8+9DCaiKscn2Lz+ON/opFKFRAQngCJ9swBc27twavUxx4qNzOVJLdH8oGhCdl5DA4mgGGDWZz463X0HzagGUpi/RfME26uQnTkyK8eErL2yac+1VmA/QOx0RkYlrZ/pIEywkZPWusjJepCm9nlZGylaBr2mDpk8Kea+7IytO6sefiBwjX1RiqmnjnszO3jb/w5s0giUItWuFmDr14sOaFmj6wQB643eSGi42LSPG+FMea1RwUupyEPeLZq/aoJ0jmewGLv4=
|
||||
node_js: stable
|
||||
addons:
|
||||
firefox: '42.0'
|
||||
firefox: '46.0'
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
packages:
|
||||
- google-chrome-stable
|
||||
sauce_connect: true
|
||||
script:
|
||||
- xvfb-run wct
|
||||
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
|
||||
- xvfb-run wct
|
||||
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct -s 'default'; fi
|
||||
dist: trusty
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
|
||||
<!--
|
||||
This file is autogenerated based on
|
||||
https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
|
||||
|
||||
If you edit that file, it will get updated everywhere else.
|
||||
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
|
||||
## 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.
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
|
@ -51,14 +56,14 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
|
|||
|
||||
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
|
||||
(For a single issue)
|
||||
Fixes #20
|
||||
|
||||
(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:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-a11y-announcer",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"description": "A singleton element that simplifies announcing text to screen readers.",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
|
@ -18,7 +18,7 @@
|
|||
"main": "iron-a11y-announcer.html",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"dependencies": {
|
||||
"polymer": "polymer/polymer#^1.0.0"
|
||||
"polymer": "polymer/polymer#^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
|
||||
|
@ -27,7 +27,7 @@
|
|||
"paper-styles": "polymerelements/paper-styles#^1.0.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
"web-component-tester": "polymer/web-component-tester#^3.4.0"
|
||||
"web-component-tester": "^4.0.0"
|
||||
},
|
||||
"ignore": []
|
||||
}
|
||||
|
|
|
@ -1,4 +1,13 @@
|
|||
<!--
|
||||
@license
|
||||
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
|
||||
-->
|
||||
<!--
|
||||
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
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS
|
||||
|
@ -12,6 +21,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<link rel="import" href="../iron-a11y-announcer.html">
|
||||
|
||||
<dom-module id="x-announces">
|
||||
<template>
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
|
@ -24,7 +34,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
|
||||
<paper-button on-tap="_onTapAnnounce" raised>Announce</paper-button>
|
||||
<span id="content" aria-hidden="true">
|
||||
<content></content>
|
||||
|
|
|
@ -45,6 +45,7 @@ Note: announcements are only audible if you have a screen reader enabled.
|
|||
-->
|
||||
|
||||
<dom-module id="iron-a11y-announcer">
|
||||
<template>
|
||||
<style>
|
||||
:host {
|
||||
display: inline-block;
|
||||
|
@ -52,8 +53,6 @@ Note: announcements are only audible if you have a screen reader enabled.
|
|||
clip: rect(0px,0px,0px,0px);
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div aria-live$="[[mode]]">[[_text]]</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
<!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
|
||||
|
@ -7,10 +6,7 @@ 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>
|
||||
--><html><head>
|
||||
<meta charset="utf-8">
|
||||
<title>iron-a11y-announcer tests</title>
|
||||
<script src="../../webcomponentsjs/webcomponents.js"></script>
|
||||
|
@ -19,8 +15,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<body>
|
||||
<script>
|
||||
WCT.loadSuites([
|
||||
'iron-a11y-announcer.html'
|
||||
'iron-a11y-announcer.html',
|
||||
'iron-a11y-announcer.html?dom=shadow'
|
||||
]);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
</body></html>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-a11y-keys-behavior",
|
||||
"version": "1.1.6",
|
||||
"version": "1.1.7",
|
||||
"description": "A behavior that enables keybindings for greater a11y.",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
|
@ -19,7 +19,7 @@
|
|||
"main": "iron-a11y-keys-behavior.html",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
"polymer": "Polymer/polymer#^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"paper-styles": "PolymerElements/paper-styles#^1.0.2",
|
||||
|
@ -31,11 +31,11 @@
|
|||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior",
|
||||
"_release": "1.1.6",
|
||||
"_release": "1.1.7",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.1.6",
|
||||
"commit": "28435b2e02d0e5e5268e984d925b03643cea5e34"
|
||||
"tag": "v1.1.7",
|
||||
"commit": "cde403dee704a1d3ea5f7cb49067f0eab31a8afa"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -6,8 +6,10 @@ before_script:
|
|||
- polylint
|
||||
env:
|
||||
global:
|
||||
- secure: OZhLlPsjjnWU4FyZ+RKq5i/Nv/tElvcjr9+OT04ENGKfh9+fkuij/XdHJQe6EpOCjrNkwt23c+I6V5YWRrSatRX/AxEkViW8EXnF32rX3HV8fWnjD6Vfn+4Qz82y4huc9II8OV5I7jFDln6yzEGZn08zAtbmhj5dSpYtT1spSf/ZuUkqn4mMRJW2wCOnzbjueP56Ry40IwQm0enLXVQLPYB3LC4fBWfT+VFrsE9qH1ZgGKcSD/n2dOD3d6xjts4FSilNp2IZ8Km5RNAFUxYmkcwrY4O2ltNtKUngWwIpeplpz0bNj5k8kOpT5xA/FT630M5sFd1ODVp846kTr/EyYTq/VCiwTaA/vDfZL85DC3O+Zt0vTHAvkxKAaXkg9sMp8gJOJ6gt6cK8rV8z7npeAUVsK1gmuHYXne1Z76SRgWwbE0/z82vyFLNgitmZDLLM1fP3TpzsK1QQg1ikn6iYXdWpHcrzBi6lk8mCafnP7D7B/yFB/Z6Y9AFI6NQI/jWP2FMMJjMWbaJVG9DAU4PWlVTiFnhfVjPI7FUEmW46/QjH1ztSZWpDA9SBozJluIpKRA1qk1EgGX1RBFBHrbFtHG//x0AGyAV6gWOfdKjl/nqcM02xFUSrDb0tkNUnEAS6K7l+X1eDaBbiaAQiakPt9Je2WvvHyc+OiZviSc72Gmc=
|
||||
- secure: vIs86+z7s1QwihkHtLBRQzlmJRSIWIadq3SlDdZHS4HOivH7fNV0d4hm8QnZYZ9X8yvSvxFCzEFdLuX1TpU0H3oy5wgYky7DnfJtsEhuOfW8dobHHZeCNi/t2FQAXpobqpRwojC3A+1b1lNrY1XNpYRz7aEialO4Yr8e1SQSLex5zw/pqm7g9Vz6PnQwobDQcGXKc6ZWc84+DqOo9qfkSlnEJC/1vQxHYpUa172UnnAnmHJ7gZKdhf9aLWJSZcSpPcoKEnvslRFmeDyRMNRDWVzcg2vHnV+tc1aYzp1wsrRW3P+oqwYlvGlxo+5U92QLXKIcKZhGblVWxe8BtXgiVzgS1sz5D11vKs61Xe46onbguG/XK3UxX9bPRK5uklkC5fwAY2hhvOTGXqimTb2YrlyEWO3BCKGBk6Is3KGyCe7c2nNEmXPUSun9X1JLGRPivJb9iBR4/WSEFvibYHl6/gIke9LdXPOCHuJ3+Iu14lCz+pwi8ADIWVuGpDIxFcorG8a3BCoxQo5VouUbSe0mcNttAvSzBNxhljaaBuFs56DLDpLRr0sGhqvfA1JzdCyzVyrk4WECfZw26pAnYCyTczVXmu5msVdKnjPJKtDqWazvIhHk2G1mk8CKb14lrN58u/Kh6PQ3miJ+61c1stBWhRDlp2QffOkBJiOATKHF+AA=
|
||||
- secure: >-
|
||||
XJ31r/5USVGZRtziCLfr8qM1pJKKQMUN1AeYbCdDFEc6i293WxZneR8PwUVhvyptu+qdyd28uy24sH+Ob7kShFbZTUaif5P4gqHPekrYToI0aHyhmVX7C1LmT7nEL8IcT62NhUwh+83eHTAdodkXgnhfQhPn9FHV24Dkvwm8OKhhzEhtTgUGVuGX9j9FyNV6n1+gf4X3Zq63+NkEUh5vpolpue4W7ul2u0sf4l0fzg9pvKPCmywUwX2i7wwAEf3CJghMu2xup54OzXTEkjjSou/ebt1ZnxaUNV1+dblfUne0v9wTD0dPF8H3DwgewwzcZSbOZmj6lFVHRzmLzWcRJOEKdDrpJkjpg7HIhNPGCKDUcNylekafqi7ezhzrkzFwkh6JCdAj7He4mv/X/OUDNjNCClB7Ms/+WPZwtACvIcR2/pvgZ+1PHbIkbIInyAe6iVMMR0oUecei/X+d04DH7iW7rrODVEu6qdibsJki0R0lR2184rrDO9pGek4rLu9sUQBDNgEM6ZLEXXByO8lpG4xStRdkg0/uR5i1/Q8kux4gIJ9yV8WLANkS8NVlmuJgIi6kbh5n4VVKaihGhbBUuTt2aL7fLnH2I6YRwjyNI9TOIRxwk4afppFYUuq6Fv+nfPcdqDOi5Y2AOXLJ3Yvco0+H57nXe/Ny29gFVW4Kftg=
|
||||
- secure: >-
|
||||
huEi/Ja2qnLatb7EJ4Jdc/XAeKphhdH6G+px7/XZY33oDawjStxakx0N/MpT0LPE1BdEWOYTzc17CzKv9R2L3ybWksqXyv/Zs+1NMTmpEAS/54Sk4E61aE3nrV5cfS2R8dBGbJhFoH1W237BDsbw9A4XhsTvhxlIsluWsZgeurbleGg+DgAmg8KlHGRddsfBFgXEk+Khhj6KPsbgPUiWhXpdnXKBPJKF7fJEAbsGR4aFK2eFbYd1OAgJg2Aye0n93IHe+SsxcKRUYteg6UK9V8fk7q5PBlvaodly4F3gH82l+zbnhcTFVW+qN0s6xDBTQzsQ55eTlO3pEezIo3u/1Lq41Yoe6scEkLs63pSYqoB3kakbhLMDJAen080ggdNg9evqvgyznKFYM7sqEcPu+KxHd043DyLTTW11y9lZ/hV3xSTdG4W8mV7+ILbIi54wMaYAcWSGMTOVM0JC/KDoVjze3tzDmfcZwiutLPBFgfrkfJQf3fyqcgvhoLKtHaWHI+76XDsXwEOS2Q5OX9oDtjoZaZ7r8Gp4dqwaKYceOrlsLbaZOLh5nJ4WnDbf4AqZkeM22QWWIfUN6aK+yhsDpQ/d+xJ+/WFENDADrMEKp0Lf3CkzAAcpHp3u65B9qsqweD5/5Je9t0GsA/NvK2xCasnNz6inYy4tAx9i4NWPcOY=
|
||||
node_js: stable
|
||||
addons:
|
||||
firefox: '46.0'
|
||||
|
@ -19,5 +21,5 @@ addons:
|
|||
sauce_connect: true
|
||||
script:
|
||||
- xvfb-run wct
|
||||
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
|
||||
- 'if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct -s ''default''; fi'
|
||||
dist: trusty
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-a11y-keys-behavior",
|
||||
"version": "1.1.6",
|
||||
"version": "1.1.7",
|
||||
"description": "A behavior that enables keybindings for greater a11y.",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
|
@ -19,7 +19,7 @@
|
|||
"main": "iron-a11y-keys-behavior.html",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
"polymer": "Polymer/polymer#^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"paper-styles": "PolymerElements/paper-styles#^1.0.2",
|
||||
|
|
|
@ -13,6 +13,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<link rel="import" href="../iron-a11y-keys-behavior.html">
|
||||
|
||||
<dom-module id="x-key-aware">
|
||||
<template>
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
|
@ -35,7 +36,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
border-radius: 5px;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
|
||||
<h4>Press any of these keys</h4>
|
||||
<input type="checkbox" checked="{{preventDefault::change}}"> prevent default = {{preventDefault}}
|
||||
<p class="keys">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-behaviors",
|
||||
"version": "1.0.16",
|
||||
"version": "1.0.17",
|
||||
"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.16",
|
||||
"_release": "1.0.17",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.16",
|
||||
"commit": "161e67233c4776e32a275a719a000865ed309393"
|
||||
"tag": "v1.0.17",
|
||||
"commit": "ef8e89b5f0aa4e8a6b51ca6491ea453bf395f94f"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
language: node_js
|
||||
sudo: required
|
||||
before_script:
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
env:
|
||||
global:
|
||||
- secure: ZOqj2XVNVwfT74rHxg/ljcAsS6FnmDpRSsXbsy1Icv9DcLHrMlmyQ10gWBjE/YXYF0Uv4akQ1qqn0TJaKOtp9HZeH+P6OPAYk2vJbWD7qp52pPtIqEFomcsUyflt4IjfaXKuN4FMod7PSWVSGJ+DxSguJvZKILkrs5d/rJdFv3c=
|
||||
- secure: clkqemGQG16TXyAPkv9LBv6x3SbT3ZM0eo8LETx4uNKi3WzlwgXxZA9b5Sr5wYzxyxFFpnhDXW7CL4+UjYu1atGNeTW2TuSaYUPHtgu67OFDr8Jbw047p1XQb5enPSt9+YxrHKfjHBiJvWulJ8rCSQshU9Rhe0DC6NrFRPFgk0A=
|
||||
- secure: H49pcRc5C6G+ti/ehtT74GZdsUsM/xCvEVJBmKq8rpck7s18R6BbH37RkF2XgYfO4rVa1Bl4KU4Wf5S6aIDYzdaq/phGtFQ04NmDYGbmBhRjwfgxlW4dJ7mkXqXCvNZkxJtAJpgzgVG+xu/I6GsO1Lp4VjGENvVYSsrkGIlSA34=
|
||||
- secure: Zq+hvOlL1RmTtMfAtO3bxqYnB7X6MY199cVCKo2J/EbsMvOHII1JvEU1+s2/UG9tgoiXkd7N2OfFOivlbQ75BDIwtvkq32KZNrUEC6vRGhbMBc8JCKkdFB/XHh1mNhQcn6Js656PhZIj2WteZYMSGYDUj7KcBBMacRZQKWuB0OU=
|
||||
node_js: stable
|
||||
addons:
|
||||
firefox: latest
|
||||
firefox: '46.0'
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
|
@ -18,6 +18,6 @@ addons:
|
|||
- google-chrome-stable
|
||||
sauce_connect: true
|
||||
script:
|
||||
- xvfb-run wct
|
||||
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
|
||||
- xvfb-run wct
|
||||
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct -s 'default'; fi
|
||||
dist: trusty
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
<!--
|
||||
This file is autogenerated based on
|
||||
https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
|
||||
|
@ -11,6 +10,7 @@ specific element:
|
|||
|
||||
jsbin=https://jsbin.com/cagaye/edit?html,output
|
||||
-->
|
||||
|
||||
# Polymer Elements
|
||||
## Guide for Contributors
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-behaviors",
|
||||
"version": "1.0.16",
|
||||
"version": "1.0.17",
|
||||
"description": "Provides a set of behaviors for the iron elements",
|
||||
"private": true,
|
||||
"authors": [
|
||||
|
|
|
@ -13,9 +13,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<link rel="import" href="../iron-control-state.html">
|
||||
|
||||
<dom-module id="simple-button">
|
||||
|
||||
<template>
|
||||
<style>
|
||||
|
||||
:host {
|
||||
display: inline-block;
|
||||
background-color: #4285F4;
|
||||
|
@ -42,11 +41,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
background-color: #3367D6;
|
||||
box-shadow: inset 0 3px 5px rgba(0,0,0,.2);
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
|
||||
<content></content>
|
||||
|
||||
</template>
|
||||
|
@ -68,4 +64,3 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</script>
|
||||
|
||||
</dom-module>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-checked-element-behavior",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"description": "Implements an element that has a checked attribute and can be added to a form",
|
||||
"authors": "The Polymer Authors",
|
||||
"keywords": [
|
||||
|
@ -19,7 +19,7 @@
|
|||
"homepage": "https://github.com/PolymerElements/iron-checked-element-behavior",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.1.0",
|
||||
"iron-validatable-behavior": "PolymerElements/iron-validatable-behavior#^1.0.0",
|
||||
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0"
|
||||
},
|
||||
|
@ -28,14 +28,14 @@
|
|||
"paper-button": "PolymerElements/paper-button#^1.0.0",
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "*",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"_release": "1.0.4",
|
||||
"_release": "1.0.5",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.4",
|
||||
"commit": "cc30263ec2871ae8f8f944948f44299d3f3cdf0d"
|
||||
"tag": "v1.0.5",
|
||||
"commit": "c70add47a9af62d30746587e8a1303fb390787c6"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-checked-element-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
33
dashboard-ui/bower_components/iron-checked-element-behavior/.github/ISSUE_TEMPLATE.md
vendored
Normal file
33
dashboard-ui/bower_components/iron-checked-element-behavior/.github/ISSUE_TEMPLATE.md
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
<!-- Instructions: https://github.com/PolymerElements/iron-checked-element-behavior/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
|
|
@ -1,22 +1,23 @@
|
|||
language: node_js
|
||||
sudo: false
|
||||
sudo: required
|
||||
before_script:
|
||||
- npm install web-component-tester
|
||||
- npm install bower
|
||||
- 'export PATH=$PWD/node_modules/.bin:$PATH'
|
||||
- bower install
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
env:
|
||||
global:
|
||||
- secure: EJSBYkW/C3ppDTbxHYRzyFPAko5R1ET1LSbdM484/j0OHGLkSIwtKrrZLNz5+QEmKSw79MpLpBoD+SfXuSCn0yKkf6tvK4mt+kRs32vKVfoWrYReVcfth+EWV7QDpTDJw1QEijT1bKUxULhP0OrT2/5vVpKpXX2zczg+VFL7IZuY3y1dsA4qWmWTfMiAk3762dZx47D5qzJ4POHlpG0i/cHH2EgqV8sFXFBctf6EY68GqzStPUuMuea6xX2wMrebg6vqQDfDb1gs8N34gxGE+u8QaqOSniW1Vzdoe1vwOUo4dbJYw3JMYK5Qn2pj3p2E4m9J609JNnBfqjS7mB5KVC7Hf5r9ul3UMsAIlOnlmSqOq1oO22/3regjWHGjlrzCNHzma2SgDhTxGaLDJl1LnsUevbVb6TGloiQPXwum8oa7dvZ1PqspqyqZEb31t/FyUnG+VXnC0YYpdRj3eRGqeoqqaNtad97DrPHP7er9LdvJIKjsXux7gUW4hKWsr+jsU/krdHpTUC8GYWdTF54EcLhxfzNYKL7voTq+xoQ2yxCOSiBmcQCviuQyVvNQyhde/+edAmOt24CLiuSQjHCbEWzBQs9QinUPRekg6+LJ1WaifTIKkhsm04AdaZrs7LR34hF+Mpqp4HHl/AfcbtVeB/W7jUnhJyMFaQDfGkpzSZs=
|
||||
- secure: izhN5Z3WdajR3ois2T55qepsvLwVg/wv8u4kVQ4TqWhUL08tka83m/W+EMzS/tcvfz7J3VkuTFrJ5scYD9kaTVhRo4dv2u+DdbPmTNcf/hmADXLVLxddyueK3bWEcBurg8+rSdqq/RdI+5CPwWeGtQl+lmjRCyBzodIpQ90zJQF4Al7nmmLuEUhiNVjuqQ3VB1pFLYgky4SVM0bfJnoKSDsZ2z9DOOJE34ZUUmcNqVcQoZ5/oM+PWdVDkUqW3vMK1lTMtE/dk6WcSztQwFyoMrW+uzEstPwUsJCyuBEx4KdioXZH3vrlxRApySfHmEf5eVWwE6jyPSHuWj/2D5O4R9LY1dq1Wcoiu3BJj19B4V3s4L2uJF+xL077d4Mna6z9dE4RSRzs8Z8MvSMTgzDkga/A25JI3XxJMJ78WTbkNQ4hVFN2xwcU5cm+fbs3Sr1ZEdFW/MWAPtUQOzscqS5Op7sSLLaiqO+R0zj56H2NA2bl/zCmbZhyLcOPl0oAfJ85bqNxyF8CoO+GZ98UG15ROigC90/HCP7TUHZnQSrGtiFGTiPTBm+VCITYmC5IEyJBTwgqh/ljbDzz4UuSZ3KsldL3MwWnqO3tGr6VvPfqKF6xq0vuyn9P7f9WNAYwZGcRi3AtxtY+znO+IGv2sGmrfo7ZY+U4nceXTEDrG8OY0Jo=
|
||||
node_js: 4
|
||||
- secure: zj5WTkJrZAy1QK0j65jHEsHluT4B/PZl0u3iVEWnyd4CSUbHh3rS5NytZTA8wZ63DYnUcrdbhPeIQI3UKaVBUM2MO/K4MwsC2YTRpifpCLbC+wlRV9WRZNZ9CJ3hu6leshOBWHzZucUWAcKtyQRm66rAU+90ZaJcrBPC/xtgPG1n/Bm2aygr5IA36vJy80Zpwk1+yFmb08eu7jpzNVhcFor+VX0gBW3rxeX0kvzhHGn0bTLxKztNB56Oe+bzx6vU8ACjBcSylouOtPJVIk/iIh7AIDHDcpoZGzmwtVnwAV2mJQtu3V8hQ2kE8eXpDloBGID+AUfTF3YSOVQo34I1yv4T+FlB7uxWrgJo80X5IRXUe15+OoXqraZ25v736RPdTWPjV2b6cWHqdOa45wODkDY0KZ9SrmwZibF3vcfVOG21llW2jF/HC5FvDIiM7gv1ro5jsFbEIwv7ligh0KKa+TOZBphL4sEtMrpxR/zXLqBLXUbKL54A+AefHelxjDIqT3oKQylesrGZ58fEF7Fx5xDSYGJwhIEwTLsEQWIWw8sWB34yRtDBIPocqh8nNZ9pJBOdhK3oC5KK44IQnE44YrIzLRRinHzRVoywpUb5OJDxxSSvOwcqmTYbkFmRJMzfJCEj/EtYsEokmSFv8zIRRDetvenBTGouNK/VsU9xQpA=
|
||||
- secure: Q3xN3fRvTQuy/HKlkYFFnVrFo01r6Q8zgzHHK8yKNKio9T/BM0+iIMYP8mRY+qvCQxCboXuUawG6gsxxT2Zn/p7SgNZ+UHq7DcLmocqxmECdGfqra6Hy9Y7BZVYPWlWIADkNUjI0RfOz69/3o/TAFlt4Cnw3BX3ip0o0Rri5/jzj0Nn+xSF+onyMnpH2gQvUE77MHvCuWTPki3R86Bz8RRzbTwKYwVa0oVca7jzdPtOjqzsnz8k9X0HVwQEpHGjqgTP3lg8EotON0rac/ayWs3J3bk9ye5AfvdTCYcZnDcz8POAN6FeC2Xey7oqQO4N8vFagru88mC3AmN67ZYqwI0fmDEYre20lnXFAFBFzsiu4FvKMgFYi/C5tG5ngSR5XcXwLskax82Un7yYYRzVbyhFSxxWZCqIC4cJ5d+E0Wex4eEYDwAlZ9AFP/hRJ2qrBVUbzXeGVMkHlg4qtdUIzHRkMUmjvEWVzTvk0Xa2wD+S0mYPcBwQcscoZy9zqdJM4hfbG9IGi02/DyrTOL3IuNH8WHHvGWS4ajDhSRkGCV4I5VtGKQ/Y3RA/pU6AaI7tVcDhbxOyIPKuOXO6PWuZOiJhhPQ/kceMkUXeh0TmsDtSBpe5OKCnjsdSn02lTT5yYf4nlVIVczP9p6zBerXorzZk1/S3CRBtqYZPgRrefbCw=
|
||||
node_js: stable
|
||||
addons:
|
||||
firefox: latest
|
||||
firefox: '46.0'
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
packages:
|
||||
- google-chrome-stable
|
||||
sauce_connect: true
|
||||
script:
|
||||
- xvfb-run wct
|
||||
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
|
||||
- xvfb-run wct
|
||||
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct -s 'default'; fi
|
||||
dist: trusty
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
|
||||
<!--
|
||||
This file is autogenerated based on
|
||||
https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
|
||||
|
||||
If you edit that file, it will get updated everywhere else.
|
||||
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
|
||||
## 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.
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
|
@ -51,14 +56,14 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
|
|||
|
||||
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
|
||||
(For a single issue)
|
||||
Fixes #20
|
||||
|
||||
(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:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-checked-element-behavior",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"description": "Implements an element that has a checked attribute and can be added to a form",
|
||||
"authors": "The Polymer Authors",
|
||||
"keywords": [
|
||||
|
@ -19,7 +19,7 @@
|
|||
"homepage": "https://github.com/PolymerElements/iron-checked-element-behavior",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.1.0",
|
||||
"iron-validatable-behavior": "PolymerElements/iron-validatable-behavior#^1.0.0",
|
||||
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0"
|
||||
},
|
||||
|
@ -28,7 +28,7 @@
|
|||
"paper-button": "PolymerElements/paper-button#^1.0.0",
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "*",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<link rel="import" href="../iron-checked-element-behavior.html">
|
||||
|
||||
<dom-module id="simple-checkbox">
|
||||
<template>
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
|
@ -27,7 +28,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
|
||||
<input type="checkbox" id="checkbox" on-tap="_onCheckTap">
|
||||
<span id="labelText">{{label}}</span>
|
||||
<paper-button raised on-click="_onClick">validate</paper-button>
|
||||
|
|
|
@ -75,10 +75,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
/**
|
||||
* Returns false if the element is required and not checked, and true otherwise.
|
||||
* @param {*=} _value Ignored.
|
||||
* @return {boolean} true if `required` is false, or if `required` and `checked` are both true.
|
||||
* @return {boolean} true if `required` is false or if `checked` is true.
|
||||
*/
|
||||
_getValidity: function(_value) {
|
||||
return this.disabled || !this.required || (this.required && this.checked);
|
||||
return this.disabled || !this.required || this.checked;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
bower_components
|
|
@ -1,31 +0,0 @@
|
|||
{
|
||||
"name": "iron-collapse",
|
||||
"version": "1.0.3",
|
||||
"description": "Provides a collapsable container",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"container"
|
||||
],
|
||||
"private": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PolymerElements/iron-collapse"
|
||||
},
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"homepage": "https://github.com/PolymerElements/iron-collapse",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "*",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
}
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
<!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>iron-collapse demo</title>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="../iron-collapse.html">
|
||||
<link rel="stylesheet" href="../../paper-styles/demo.css">
|
||||
|
||||
<style>
|
||||
.heading {
|
||||
padding: 10px 15px;
|
||||
margin-top: 20px;
|
||||
background-color: #f3f3f3;
|
||||
border: 1px solid #dedede;
|
||||
border-top-left-radius: 5px;
|
||||
border-top-right-radius: 5px;
|
||||
font-size: 18px;
|
||||
cursor: pointer;
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 15px;
|
||||
border: 1px solid #dedede;
|
||||
border-top: none;
|
||||
border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body unresolved>
|
||||
|
||||
<button class="heading" onclick="document.querySelector('#collapse1').toggle();">Collapse #1</button>
|
||||
<iron-collapse id="collapse1">
|
||||
<div class="content">
|
||||
<div>Lorem ipsum dolor sit amet, per in nusquam nominavi periculis, sit elit oportere ea, id minim maiestatis incorrupte duo. Dolorum verterem ad ius, his et nullam verterem. Eu alia debet usu, an doming tritani est. Vix ad ponderum petentium suavitate, eum eu tempor populo, graece sententiae constituam vim ex. Cu torquatos reprimique neglegentur nec, voluptua periculis has ut, at eos discere deleniti sensibus. Lorem ipsum dolor sit amet, per in nusquam nominavi periculis, sit elit oportere ea, id minim maiestatis incorrupte duo. Dolorum verterem ad ius, his et nullam verterem. Eu alia debet usu, an doming tritani est. Vix ad ponderum petentium suavitate, eum eu tempor populo, graece sententiae constituam vim ex. Cu torquatos reprimique neglegentur nec, voluptua periculis has ut, at eos discere deleniti sensibus.</div>
|
||||
</div>
|
||||
</iron-collapse>
|
||||
|
||||
<button class="heading" onclick="document.querySelector('#collapse2').toggle();">Collapse #2</button>
|
||||
<iron-collapse id="collapse2">
|
||||
<div class="content">
|
||||
<div>Pro saepe pertinax ei, ad pri animal labores suscipiantur. Modus commodo minimum eum te, vero utinam assueverit per eu, zril oportere suscipiantur pri te. Partem percipitur deterruisset ad sea, at eam suas luptatum dissentiunt. No error alienum pro, erant senserit ex mei, pri semper alterum no. Ut habemus menandri vulputate mea. Feugiat verterem ut sed. Dolores maiestatis id per. Pro saepe pertinax ei, ad pri animal labores suscipiantur. Modus commodo minimum eum te, vero utinam assueverit per eu, zril oportere suscipiantur pri te. Partem percipitur deterruisset ad sea, at eam suas luptatum dissentiunt. No error alienum pro, erant senserit ex mei, pri semper alterum no. Ut habemus menandri vulputate mea. Feugiat verterem ut sed. Dolores maiestatis id per.</div>
|
||||
|
||||
<button class="heading" onclick="document.querySelector('#collapse3').toggle();">Collapse #3</button>
|
||||
<iron-collapse id="collapse3">
|
||||
<div class="content">
|
||||
<div>Iisque perfecto dissentiet cum et, sit ut quot mandamus, ut vim tibique splendide instructior. Id nam odio natum malorum, tibique copiosae expetenda mel ea. Mea melius malorum ut. Ut nec tollit vocent timeam. Facer nonumy numquam id his, munere salutatus consequuntur eum et, eum cotidieque definitionem signiferumque id. Ei oblique graecis patrioque vis, et probatus dignissim inciderint vel. Sed id paulo erroribus, autem semper accusamus in mel. Iisque perfecto dissentiet cum et, sit ut quot mandamus, ut vim tibique splendide instructior. Id nam odio natum malorum, tibique copiosae expetenda mel ea. Mea melius malorum ut. Ut nec tollit vocent timeam. Facer nonumy numquam id his, munere salutatus consequuntur eum et, eum cotidieque definitionem signiferumque id. Ei oblique graecis patrioque vis, et probatus dignissim inciderint vel. Sed id paulo erroribus, autem semper accusamus in mel.</div>
|
||||
</div>
|
||||
</iron-collapse>
|
||||
</div>
|
||||
</iron-collapse>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,23 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 225 126" enable-background="new 0 0 225 126" xml:space="preserve">
|
||||
<g id="background" display="none">
|
||||
<rect display="inline" fill="#B0BEC5" width="225" height="126"/>
|
||||
<path display="inline" fill="none" d="M167.5,51.7c3.7-0.8,6.9,2.4,6.1,6.1c-0.4,1.9-1.9,3.4-3.8,3.8c-3.7,0.8-6.9-2.4-6.1-6.1
|
||||
C164.2,53.6,165.7,52.1,167.5,51.7z"/>
|
||||
</g>
|
||||
<g id="label">
|
||||
</g>
|
||||
<g id="art">
|
||||
<path d="M151,102H73V52h78V102z M75,100h74V54H75V100z"/>
|
||||
<path d="M151,38H73V24h78V38z M75,36h74V26H75V36z"/>
|
||||
<circle cx="171" cy="51" r="4"/>
|
||||
<path d="M151,72v-2c10.5,0,19-8.5,19-19s-8.5-19-19-19v-2c11.6,0,21,9.4,21,21S162.6,72,151,72z"/>
|
||||
<g id="ic_x5F_add_x0D_">
|
||||
</g>
|
||||
</g>
|
||||
<g id="Guides">
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1 KiB |
|
@ -1,31 +0,0 @@
|
|||
<!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>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||
|
||||
<title>iron-collapse</title>
|
||||
|
||||
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<iron-component-page></iron-component-page>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,200 +0,0 @@
|
|||
<!--
|
||||
@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
|
||||
-->
|
||||
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
|
||||
<!--
|
||||
`iron-collapse` creates a collapsible block of content. By default, the content
|
||||
will be collapsed. Use `opened` or `toggle()` to show/hide the content.
|
||||
|
||||
<button on-click="toggle">toggle collapse</button>
|
||||
|
||||
<iron-collapse id="collapse">
|
||||
<div>Content goes here...</div>
|
||||
</iron-collapse>
|
||||
|
||||
...
|
||||
|
||||
toggle: function() {
|
||||
this.$.collapse.toggle();
|
||||
}
|
||||
|
||||
`iron-collapse` adjusts the height/width of the collapsible element to show/hide
|
||||
the content. So avoid putting padding/margin/border on the collapsible directly,
|
||||
and instead put a div inside and style that.
|
||||
|
||||
<style>
|
||||
.collapse-content {
|
||||
padding: 15px;
|
||||
border: 1px solid #dedede;
|
||||
}
|
||||
</style>
|
||||
|
||||
<iron-collapse>
|
||||
<div class="collapse-content">
|
||||
<div>Content goes here...</div>
|
||||
</div>
|
||||
</iron-collapse>
|
||||
|
||||
@group Iron Elements
|
||||
@hero hero.svg
|
||||
@demo demo/index.html
|
||||
@element iron-collapse
|
||||
-->
|
||||
|
||||
<dom-module id="iron-collapse">
|
||||
|
||||
<style>
|
||||
|
||||
:host {
|
||||
display: block;
|
||||
transition-duration: 300ms;
|
||||
}
|
||||
|
||||
:host(.iron-collapse-closed) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:host(:not(.iron-collapse-opened)) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
|
||||
<content></content>
|
||||
|
||||
</template>
|
||||
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
|
||||
Polymer({
|
||||
|
||||
is: 'iron-collapse',
|
||||
|
||||
properties: {
|
||||
|
||||
/**
|
||||
* If true, the orientation is horizontal; otherwise is vertical.
|
||||
*
|
||||
* @attribute horizontal
|
||||
*/
|
||||
horizontal: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
observer: '_horizontalChanged'
|
||||
},
|
||||
|
||||
/**
|
||||
* Set opened to true to show the collapse element and to false to hide it.
|
||||
*
|
||||
* @attribute opened
|
||||
*/
|
||||
opened: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
notify: true,
|
||||
observer: '_openedChanged'
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
hostAttributes: {
|
||||
role: 'group',
|
||||
'aria-expanded': 'false'
|
||||
},
|
||||
|
||||
listeners: {
|
||||
transitionend: '_transitionEnd'
|
||||
},
|
||||
|
||||
ready: function() {
|
||||
// Avoid transition at the beginning e.g. page loads and enable
|
||||
// transitions only after the element is rendered and ready.
|
||||
this._enableTransition = true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggle the opened state.
|
||||
*
|
||||
* @method toggle
|
||||
*/
|
||||
toggle: function() {
|
||||
this.opened = !this.opened;
|
||||
},
|
||||
|
||||
show: function() {
|
||||
this.opened = true;
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
this.opened = false;
|
||||
},
|
||||
|
||||
updateSize: function(size, animated) {
|
||||
this.enableTransition(animated);
|
||||
var s = this.style;
|
||||
var nochange = s[this.dimension] === size;
|
||||
s[this.dimension] = size;
|
||||
if (animated && nochange) {
|
||||
this._transitionEnd();
|
||||
}
|
||||
},
|
||||
|
||||
enableTransition: function(enabled) {
|
||||
this.style.transitionDuration = (enabled && this._enableTransition) ? '' : '0s';
|
||||
},
|
||||
|
||||
_horizontalChanged: function() {
|
||||
this.dimension = this.horizontal ? 'width' : 'height';
|
||||
this.style.transitionProperty = this.dimension;
|
||||
},
|
||||
|
||||
_openedChanged: function() {
|
||||
if (this.opened) {
|
||||
this.toggleClass('iron-collapse-closed', false);
|
||||
this.updateSize('auto', false);
|
||||
var s = this._calcSize();
|
||||
this.updateSize('0px', false);
|
||||
// force layout to ensure transition will go
|
||||
/** @suppress {suspiciousCode} */ this.offsetHeight;
|
||||
this.updateSize(s, true);
|
||||
}
|
||||
else {
|
||||
this.toggleClass('iron-collapse-opened', false);
|
||||
this.updateSize(this._calcSize(), false);
|
||||
// force layout to ensure transition will go
|
||||
/** @suppress {suspiciousCode} */ this.offsetHeight;
|
||||
this.updateSize('0px', true);
|
||||
}
|
||||
this.setAttribute('aria-expanded', this.opened ? 'true' : 'false');
|
||||
|
||||
},
|
||||
|
||||
_transitionEnd: function() {
|
||||
if (this.opened) {
|
||||
this.updateSize('auto', false);
|
||||
}
|
||||
this.toggleClass('iron-collapse-closed', !this.opened);
|
||||
this.toggleClass('iron-collapse-opened', this.opened);
|
||||
this.enableTransition(false);
|
||||
},
|
||||
|
||||
_calcSize: function() {
|
||||
return this.getBoundingClientRect()[this.dimension] + 'px';
|
||||
},
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
|
@ -1,93 +0,0 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
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>iron-collapse-basic</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-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-collapse.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="test">
|
||||
<template>
|
||||
<iron-collapse id="collapse" opened>
|
||||
<div>
|
||||
Forma temperiemque cornua sidera dissociata cornua recessit innabilis ligavit: solidumque coeptis nullus caelum sponte phoebe di regat mentisque tanta austro capacius amphitrite sui quin postquam semina fossae liquidum umor galeae coeptis caligine liberioris quin liquidum matutinis invasit posset: flexi glomeravit radiis certis invasit oppida postquam onerosior inclusum dominari opifex terris pace finxit quam aquae nunc sine altae auroram quam habentem homo totidemque scythiam in pondus ensis tegit caecoque poena lapidosos humanas coeperunt poena aetas totidem nec natura aethera locavit caelumque distinxit animalibus phoebe cingebant moderantum porrexerat terrae possedit sua sole diu summaque obliquis melioris orbem
|
||||
</div>
|
||||
</iron-collapse>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
|
||||
suite('basic', function() {
|
||||
|
||||
var collapse;
|
||||
var delay = 500;
|
||||
var collapseHeight;
|
||||
|
||||
setup(function () {
|
||||
collapse = fixture('test');
|
||||
});
|
||||
|
||||
test('opened attribute', function() {
|
||||
assert.equal(collapse.opened, true);
|
||||
});
|
||||
|
||||
test('horizontal attribute', function() {
|
||||
assert.equal(collapse.horizontal, false);
|
||||
});
|
||||
|
||||
test('default opened height', function(done) {
|
||||
setTimeout(function() {
|
||||
// store height
|
||||
collapseHeight = getComputedStyle(collapse).height;
|
||||
// verify height not 0px
|
||||
assert.notEqual(collapseHeight, '0px');
|
||||
done();
|
||||
}, delay);
|
||||
});
|
||||
|
||||
test('set opened to false', function(done) {
|
||||
collapse.opened = false;
|
||||
setTimeout(function() {
|
||||
var h = getComputedStyle(collapse).height;
|
||||
// verify height is 0px
|
||||
assert.equal(h, '0px');
|
||||
done();
|
||||
}, delay);
|
||||
});
|
||||
|
||||
test('set opened to true', function(done) {
|
||||
collapse.opened = true;
|
||||
setTimeout(function() {
|
||||
var h = getComputedStyle(collapse).height;
|
||||
// verify height
|
||||
assert.equal(h, collapseHeight);
|
||||
done();
|
||||
}, delay);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,91 +0,0 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
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>iron-collapse-horizontal</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-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-collapse.html">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="test">
|
||||
<template>
|
||||
<iron-collapse id="collapse" opened horizontal>
|
||||
<div>
|
||||
Forma temperiemque cornua sidera dissociata cornua recessit innabilis ligavit: solidumque coeptis nullus caelum sponte phoebe di regat mentisque tanta austro capacius amphitrite sui quin postquam semina fossae liquidum umor galeae coeptis caligine liberioris quin liquidum matutinis invasit posset: flexi glomeravit radiis certis invasit oppida postquam onerosior inclusum dominari opifex terris pace finxit quam aquae nunc sine altae auroram quam habentem homo totidemque scythiam in pondus ensis tegit caecoque poena lapidosos humanas coeperunt poena aetas totidem nec natura aethera locavit caelumque distinxit animalibus phoebe cingebant moderantum porrexerat terrae possedit sua sole diu summaque obliquis melioris orbem
|
||||
</div>
|
||||
</iron-collapse>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
|
||||
suite('horizontal', function() {
|
||||
|
||||
var collapse;
|
||||
var delay = 500;
|
||||
var collapseHeight;
|
||||
|
||||
setup(function () {
|
||||
collapse = fixture('test');
|
||||
});
|
||||
|
||||
test('opened attribute', function() {
|
||||
assert.equal(collapse.opened, true);
|
||||
});
|
||||
|
||||
test('horizontal attribute', function() {
|
||||
assert.equal(collapse.horizontal, true);
|
||||
});
|
||||
|
||||
test('default opened width', function(done) {
|
||||
setTimeout(function() {
|
||||
// store actual width
|
||||
width = getComputedStyle(collapse).width;
|
||||
// verify width not 0px
|
||||
assert.notEqual(width, '0px');
|
||||
done();
|
||||
}, delay);
|
||||
});
|
||||
|
||||
test('set opened to false', function(done) {
|
||||
collapse.opened = false;
|
||||
setTimeout(function() {
|
||||
var h = getComputedStyle(collapse).width;
|
||||
// verify width is 0px
|
||||
assert.equal(h, '0px');
|
||||
done();
|
||||
}, delay);
|
||||
});
|
||||
|
||||
test('set opened to true', function(done) {
|
||||
collapse.opened = true;
|
||||
setTimeout(function() {
|
||||
var h = getComputedStyle(collapse).width;
|
||||
// verify width
|
||||
assert.equal(h, width);
|
||||
done();
|
||||
}, delay);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,31 +0,0 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
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>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title>Tests</title>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script>
|
||||
|
||||
WCT.loadSuites([
|
||||
'basic.html',
|
||||
'horizontal.html'
|
||||
]);
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "iron-icon",
|
||||
"private": true,
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "An element that supports displaying an icon",
|
||||
"main": "iron-icon.html",
|
||||
|
@ -21,7 +21,7 @@
|
|||
"dependencies": {
|
||||
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
|
||||
"iron-meta": "polymerelements/iron-meta#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
"polymer": "Polymer/polymer#^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
|
@ -33,11 +33,11 @@
|
|||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-icon",
|
||||
"_release": "1.0.8",
|
||||
"_release": "1.0.9",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.8",
|
||||
"commit": "f36b38928849ef3853db727faa8c9ef104d611eb"
|
||||
"tag": "v1.0.9",
|
||||
"commit": "f6fb241901377e30e2c9c6cd47e3e8e8beb6574d"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-icon.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!-- Instructions: https://github.com/PolymerElements/iron-selector/CONTRIBUTING.md#filing-issues -->
|
||||
<!-- Instructions: https://github.com/PolymerElements/iron-icon/CONTRIBUTING.md#filing-issues -->
|
||||
### Description
|
||||
<!-- Example: The `paper-foo` element causes the page to turn pink when clicked. -->
|
||||
|
|
@ -1,25 +1,23 @@
|
|||
language: node_js
|
||||
sudo: false
|
||||
sudo: required
|
||||
before_script:
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
env:
|
||||
global:
|
||||
- secure: Cyo7MV8FASyf2EZyrSmDbmoZmopQhuTbV79Ntl6eDq6JxEOAApULHn6W+ht0tvmaA+L2cRNq3Z4uvy3tbZCI5SCgQuEKLDJFoghzNp4Izc54bBlJzsxMjcgxEEMbw1jDIKp+PJ+1+8oyT5H1NogcGoNWcvMCjn+8Vl64/999mhw=
|
||||
- secure: dI3wfjJoooFlq6Kb8V1fkbc9N5jrvw7dExN4tp4KlvJFiXIvgb823jEyLGnK/oeVLwP9yncvOYxiG/enNbjpk6fId3zjwptN2H1am3pIsPQASOZJ0Pwvwa1dX7EYGk2kxOwY1pyX4is/QRVDrlUkLm3YAPOFfYJEiVB7m6TNFIo=
|
||||
- CXX=g++-4.8
|
||||
- secure: TTp7q3OKEpaFqnqbYczhMd8iXTa1Ya0jOQVq1OhljpJogLWb78qvHLHgnxgMWkw+/KDyE5KHW1CXhYUQa7C9QF2Zn7uoN27+7+4q7HuK3pTuUtqdfstLVuLHQrfK6VqUT4XjSpeMzNX/HxuD3EMBH0bMBR4CIr76sLJOuIL/XF8=
|
||||
- secure: damHvQXygRYIJG/8Vmqh7U4zxoi5224JIZiZVQL6I5z//s5zqHq6AqwDyfOoc0zWndJCwE8NvOzKD/lmVYXIsPcY95kkZS45Dbye0krYWUzKnv42rDi/7olXcg647iAEDVhW3BRHmA+opzQtKUpAkXl97DtPVkszLL1ReyNyv3A=
|
||||
node_js: stable
|
||||
addons:
|
||||
firefox: latest
|
||||
firefox: '46.0'
|
||||
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"
|
||||
- xvfb-run wct
|
||||
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct -s 'default'; fi
|
||||
dist: trusty
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
<!--
|
||||
This file is autogenerated based on
|
||||
https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
|
||||
|
@ -11,6 +10,7 @@ specific element:
|
|||
|
||||
jsbin=https://jsbin.com/cagaye/edit?html,output
|
||||
-->
|
||||
|
||||
# Polymer Elements
|
||||
## Guide for Contributors
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "iron-icon",
|
||||
"private": true,
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "An element that supports displaying an icon",
|
||||
"main": "iron-icon.html",
|
||||
|
@ -21,7 +21,7 @@
|
|||
"dependencies": {
|
||||
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
|
||||
"iron-meta": "polymerelements/iron-meta#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
"polymer": "Polymer/polymer#^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
|
|
|
@ -82,7 +82,7 @@ Custom property | Description | Default
|
|||
-->
|
||||
|
||||
<dom-module id="iron-icon">
|
||||
|
||||
<template>
|
||||
<style>
|
||||
:host {
|
||||
@apply(--layout-inline);
|
||||
|
@ -98,8 +98,6 @@ Custom property | Description | Default
|
|||
height: var(--iron-icon-height, 24px);
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
{
|
||||
"name": "iron-location",
|
||||
"version": "0.8.5",
|
||||
"description": "Bidirectional data binding into the page's URL.",
|
||||
"private": true,
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"routing"
|
||||
],
|
||||
"main": [
|
||||
"iron-location.html",
|
||||
"iron-query-params.html"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-location.git"
|
||||
},
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"homepage": "https://github.com/PolymerElements/iron-location",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"promise-polyfill": "polymerlabs/promise-polyfill#^1.0.0",
|
||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
|
||||
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
|
||||
"paper-input": "polymerelements/paper-input#^1.0.0",
|
||||
"paper-slider": "polymerelements/paper-slider#^1.0.0",
|
||||
"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",
|
||||
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.2.3"
|
||||
},
|
||||
"_release": "0.8.5",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v0.8.5",
|
||||
"commit": "d7c5a9c991bf5e94094c16e94eb34e2eb30db4b0"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-location.git",
|
||||
"_target": "^0.8.0",
|
||||
"_originalSource": "PolymerElements/iron-location"
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
bower_components
|
|
@ -1,23 +0,0 @@
|
|||
language: node_js
|
||||
sudo: required
|
||||
node_js: stable
|
||||
addons:
|
||||
firefox: '46.0'
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
packages:
|
||||
- google-chrome-stable
|
||||
sauce_connect: true
|
||||
before_script:
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
script:
|
||||
- xvfb-run wct
|
||||
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
|
||||
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=
|
||||
dist: trusty
|
|
@ -1,77 +0,0 @@
|
|||
<!--
|
||||
This file is autogenerated based on
|
||||
https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
|
||||
|
||||
If you edit that file, it will get updated everywhere else.
|
||||
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/lebawa/edit?html,output
|
||||
-->
|
||||
|
||||
# Polymer Elements
|
||||
## Guide for Contributors
|
||||
|
||||
Polymer Elements are built in the open, and the Polymer authors eagerly encourage any and all forms of community contribution. When contributing, please follow these guidelines:
|
||||
|
||||
### Filing Issues
|
||||
|
||||
**If you are filing an issue to request a feature**, please provide a clear description of the feature. It can be helpful to describe answers to the following questions:
|
||||
|
||||
1. **Who will use the feature?** _“As someone filling out a form…”_
|
||||
2. **When will they use the feature?** _“When I enter an invalid value…”_
|
||||
3. **What is the user’s goal?** _“I want to be visually notified that the value needs to be corrected…”_
|
||||
|
||||
**If you are filing an issue to report a bug**, please provide:
|
||||
|
||||
1. **A clear description of the bug and related expectations.** Consider using the following example template for reporting a bug:
|
||||
|
||||
```markdown
|
||||
The `paper-foo` element causes the page to turn pink when clicked.
|
||||
|
||||
## Expected outcome
|
||||
|
||||
The page stays the same color.
|
||||
|
||||
## Actual outcome
|
||||
|
||||
The page turns pink.
|
||||
|
||||
## Steps to reproduce
|
||||
|
||||
1. Put a `paper-foo` element in the page.
|
||||
2. Open the page in a web browser.
|
||||
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: [https://jsbin.com/lebawa/edit?html,output](https://jsbin.com/lebawa/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.
|
||||
|
||||
### Submitting Pull Requests
|
||||
|
||||
**Before creating a pull request**, please ensure that an issue exists for the corresponding change in the pull request that you intend to make. **If an issue does not exist, please create one per the guidelines above**. The goal is to discuss the design and necessity of the proposed change with Polymer authors and community before diving into a pull request.
|
||||
|
||||
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 in the pull request description using the following syntax:
|
||||
|
||||
```markdown
|
||||
(For a single issue)
|
||||
Fixes #20
|
||||
|
||||
(For multiple issues)
|
||||
Fixes #32, fixes #40
|
||||
```
|
||||
|
||||
2. **A succinct description of the design** used to fix any related issues. For example:
|
||||
|
||||
```markdown
|
||||
This fixes #20 by removing styles that leaked which would cause the page to turn pink whenever `paper-foo` is clicked.
|
||||
```
|
||||
|
||||
3. **At least one test for each bug fixed or feature added** as part of the pull request. Pull requests that fix bugs or add features without accompanying tests will not be considered.
|
||||
|
||||
If a proposed change contains multiple commits, please [squash commits](https://www.google.com/url?q=http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request) to as few as is necessary to succinctly express the change. A Polymer author can help you squash commits, so don’t be afraid to ask us if you need help with that!
|
|
@ -1,40 +0,0 @@
|
|||
{
|
||||
"name": "iron-location",
|
||||
"version": "0.8.5",
|
||||
"description": "Bidirectional data binding into the page's URL.",
|
||||
"private": true,
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"routing"
|
||||
],
|
||||
"main": [
|
||||
"iron-location.html",
|
||||
"iron-query-params.html"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-location.git"
|
||||
},
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"homepage": "https://github.com/PolymerElements/iron-location",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"promise-polyfill": "polymerlabs/promise-polyfill#^1.0.0",
|
||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
|
||||
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
|
||||
"paper-input": "polymerelements/paper-input#^1.0.0",
|
||||
"paper-slider": "polymerelements/paper-slider#^1.0.0",
|
||||
"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",
|
||||
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.2.3"
|
||||
}
|
||||
}
|
|
@ -1,126 +0,0 @@
|
|||
<!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>iron-location</title>
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="../../polymer/polymer.html">
|
||||
<link rel="import" href="../iron-location.html">
|
||||
<link rel="import" href="../../paper-styles/typography.html">
|
||||
<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>
|
||||
<style>
|
||||
div.inputs {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
label {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.inputs, .history_entries {
|
||||
@apply(--layout-vertical);
|
||||
@apply(--layout-flex);
|
||||
padding: 20px;
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.container {
|
||||
@apply(--layout-horizontal);
|
||||
}
|
||||
</style>
|
||||
<iron-location path="{{path}}" hash="{{hash}}" query="{{query}}"
|
||||
dwell-time="{{dwellTime}}">
|
||||
</iron-location>
|
||||
|
||||
<div class="container">
|
||||
<div class="inputs">
|
||||
<h3>URL</h3>
|
||||
<paper-input label="path" value="{{path}}" always-float-label>
|
||||
</paper-input>
|
||||
<paper-input label="hash" value="{{hash}}" always-float-label>
|
||||
</paper-input>
|
||||
<paper-input label='query' value='{{query}}' always-float-label>
|
||||
</paper-input>
|
||||
</div>
|
||||
<div class="history_entries">
|
||||
<h3>Dwell Time</h3>
|
||||
<p>
|
||||
iron-location won't add extraneous entries to the browser's history
|
||||
when changes come in quick succession.
|
||||
</p>
|
||||
<p>
|
||||
A new history entry will only be added if iron-location stays in
|
||||
the same state longer than dwellTime.
|
||||
</p>
|
||||
<div>
|
||||
<label>History added: </label>
|
||||
{{historyElementsAdded}} entries
|
||||
</div>
|
||||
<div>
|
||||
<label>Dwell time:</label>
|
||||
{{inSeconds(dwellTime)}}s
|
||||
</div>
|
||||
<paper-slider min="-1" max="5000" value="2000" step="100"
|
||||
immediate-value="{{dwellTime}}">
|
||||
</paper-slider>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
window.addEventListener('WebComponentsReady', function() {
|
||||
Polymer({
|
||||
is: 'iron-location-demo',
|
||||
properties: {
|
||||
historyElementsAdded: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
observers: [
|
||||
'checkHistorySize(path, hash, query, startingHistoryLength)'
|
||||
],
|
||||
ready: function() {
|
||||
this.startingHistoryLength = window.history.length;
|
||||
},
|
||||
checkHistorySize: function() {
|
||||
this.historyElementsAdded =
|
||||
window.history.length - this.startingHistoryLength;
|
||||
},
|
||||
inSeconds: function(dwellTime) {
|
||||
if (dwellTime === -1) {
|
||||
return -1;
|
||||
}
|
||||
return (Math.round(dwellTime / 100) / 10)
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
||||
|
||||
<iron-location-demo></iron-location-demo>
|
||||
</body>
|
||||
</html>
|
|
@ -1,119 +0,0 @@
|
|||
<!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>iron-query-params</title>
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="../iron-query-params.html">
|
||||
<link rel="import" href="../../paper-styles/classes/typography.html">
|
||||
<link rel="import" href="../../iron-flex-layout/classes/iron-flex-layout.html">
|
||||
<link rel="import" href="../../paper-input/paper-input.html">
|
||||
<link rel="stylesheet" href="../../paper-styles/demo.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<dom-module id='iron-query-params-demo'>
|
||||
<template>
|
||||
<style>
|
||||
div.inputs {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
label {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
}
|
||||
span.seconds {
|
||||
}
|
||||
[layout] {
|
||||
@apply(--layout);
|
||||
}
|
||||
[layout][horizontal] {
|
||||
@apply(--layout-horizontal);
|
||||
}
|
||||
[layout][horizontal] > div {
|
||||
padding: 20px;
|
||||
max-width: 500px;
|
||||
}
|
||||
[layout][vertical] {
|
||||
@apply(--layout-vertical);
|
||||
}
|
||||
[layout][flex] {
|
||||
@apply(--layout-flex);
|
||||
}
|
||||
h3 {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
<iron-query-params
|
||||
params-string='{{paramString}}' params-object='{{params}}'>
|
||||
</iron-query-params>
|
||||
|
||||
<div layout horizontal>
|
||||
<div layout vertical flex class='inputs'>
|
||||
<paper-input label='params as string'
|
||||
value='{{paramString}}' always-float-label>
|
||||
</paper-input>
|
||||
<paper-input label='params as object' value='{{paramsString}}'
|
||||
invalid='{{paramsInvalid}}'
|
||||
error-message='Should be legal JSON'
|
||||
always-float-label>
|
||||
</paper-input>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
window.addEventListener('WebComponentsReady', function() {
|
||||
Polymer({
|
||||
is: 'iron-query-params-demo',
|
||||
properties: {
|
||||
paramsString: {
|
||||
observer: 'paramsStringChanged'
|
||||
},
|
||||
params: {
|
||||
observer: 'paramsChanged'
|
||||
},
|
||||
paramsInvalid: {
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
paramsStringChanged: function() {
|
||||
if (this.ignore) {
|
||||
return;
|
||||
}
|
||||
this.ignore = true;
|
||||
try {
|
||||
this.params = JSON.parse(this.paramsString);
|
||||
this.paramsInvalid = false;
|
||||
} catch(_) {
|
||||
this.paramsInvalid = true;
|
||||
}
|
||||
this.ignore = false;
|
||||
},
|
||||
paramsChanged: function() {
|
||||
if (this.ignore) {
|
||||
return;
|
||||
}
|
||||
this.ignore = true;
|
||||
this.paramsString = JSON.stringify(this.params);
|
||||
this.paramsInvalid = false;
|
||||
this.ignore = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
||||
|
||||
<iron-query-params-demo></iron-query-params-demo>
|
||||
</body>
|
||||
</html>
|
|
@ -1,27 +0,0 @@
|
|||
<!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>iron-location</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<iron-component-page></iron-component-page>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,330 +0,0 @@
|
|||
<!--
|
||||
@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
|
||||
-->
|
||||
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
|
||||
<!--
|
||||
|
||||
The `iron-location` element manages binding to and from the current URL.
|
||||
|
||||
iron-location is the first, and lowest level element in the Polymer team's
|
||||
routing system. This is a beta release of iron-location as we continue work
|
||||
on higher level elements, and as such iron-location may undergo breaking
|
||||
changes.
|
||||
|
||||
#### Properties
|
||||
|
||||
When the URL is: `/search?query=583#details` iron-location's properties will be:
|
||||
|
||||
- path: `'/search'`
|
||||
- query: `'query=583'`
|
||||
- hash: `'details'`
|
||||
|
||||
These bindings are bidirectional. Modifying them will in turn modify the URL.
|
||||
|
||||
iron-location is only active while it is attached to the document.
|
||||
|
||||
#### Links
|
||||
|
||||
While iron-location is active in the document it will intercept clicks on links
|
||||
within your site, updating the URL pushing the updated URL out through the
|
||||
databinding system. iron-location only intercepts clicks with the intent to
|
||||
open in the same window, so middle mouse clicks and ctrl/cmd clicks work fine.
|
||||
|
||||
You can customize this behavior with the `urlSpaceRegex`.
|
||||
|
||||
#### Dwell Time
|
||||
|
||||
iron-location protects against accidental history spamming by only adding
|
||||
entries to the user's history if the URL stays unchanged for `dwellTime`
|
||||
milliseconds.
|
||||
|
||||
@demo demo/index.html
|
||||
|
||||
-->
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
Polymer({
|
||||
is: 'iron-location',
|
||||
properties: {
|
||||
/**
|
||||
* The pathname component of the URL.
|
||||
*/
|
||||
path: {
|
||||
type: String,
|
||||
notify: true,
|
||||
value: function() {
|
||||
return window.location.pathname;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* The query string portion of the URL.
|
||||
*/
|
||||
query: {
|
||||
type: String,
|
||||
notify: true,
|
||||
value: function() {
|
||||
return window.location.search.slice(1);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* The hash component of the URL.
|
||||
*/
|
||||
hash: {
|
||||
type: String,
|
||||
notify: true,
|
||||
value: function() {
|
||||
return window.location.hash.slice(1);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* If the user was on a URL for less than `dwellTime` milliseconds, it
|
||||
* won't be added to the browser's history, but instead will be replaced
|
||||
* by the next entry.
|
||||
*
|
||||
* This is to prevent large numbers of entries from clogging up the user's
|
||||
* browser history. Disable by setting to a negative number.
|
||||
*/
|
||||
dwellTime: {
|
||||
type: Number,
|
||||
value: 2000
|
||||
},
|
||||
|
||||
/**
|
||||
* A regexp that defines the set of URLs that should be considered part
|
||||
* of this web app.
|
||||
*
|
||||
* Clicking on a link that matches this regex won't result in a full page
|
||||
* navigation, but will instead just update the URL state in place.
|
||||
*
|
||||
* This regexp is given everything after the origin in an absolute
|
||||
* URL. So to match just URLs that start with /search/ do:
|
||||
* url-space-regex="^/search/"
|
||||
*
|
||||
* @type {string|RegExp}
|
||||
*/
|
||||
urlSpaceRegex: {
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
|
||||
/**
|
||||
* urlSpaceRegex, but coerced into a regexp.
|
||||
*
|
||||
* @type {RegExp}
|
||||
*/
|
||||
_urlSpaceRegExp: {
|
||||
computed: '_makeRegExp(urlSpaceRegex)'
|
||||
},
|
||||
|
||||
_lastChangedAt: {
|
||||
type: Number
|
||||
},
|
||||
|
||||
_initialized: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
}
|
||||
},
|
||||
hostAttributes: {
|
||||
hidden: true
|
||||
},
|
||||
observers: [
|
||||
'_updateUrl(path, query, hash)'
|
||||
],
|
||||
attached: function() {
|
||||
this.listen(window, 'hashchange', '_hashChanged');
|
||||
this.listen(window, 'location-changed', '_urlChanged');
|
||||
this.listen(window, 'popstate', '_urlChanged');
|
||||
this.listen(/** @type {!HTMLBodyElement} */(document.body), 'click', '_globalOnClick');
|
||||
// Give a 200ms grace period to make initial redirects without any
|
||||
// additions to the user's history.
|
||||
this._lastChangedAt = window.performance.now() - (this.dwellTime - 200);
|
||||
|
||||
this._initialized = true;
|
||||
this._urlChanged();
|
||||
},
|
||||
detached: function() {
|
||||
this.unlisten(window, 'hashchange', '_hashChanged');
|
||||
this.unlisten(window, 'location-changed', '_urlChanged');
|
||||
this.unlisten(window, 'popstate', '_urlChanged');
|
||||
this.unlisten(/** @type {!HTMLBodyElement} */(document.body), 'click', '_globalOnClick');
|
||||
this._initialized = false;
|
||||
},
|
||||
_hashChanged: function() {
|
||||
this.hash = window.location.hash.substring(1);
|
||||
},
|
||||
_urlChanged: function() {
|
||||
// We want to extract all info out of the updated URL before we
|
||||
// try to write anything back into it.
|
||||
//
|
||||
// i.e. without _dontUpdateUrl we'd overwrite the new path with the old
|
||||
// one when we set this.hash. Likewise for query.
|
||||
this._dontUpdateUrl = true;
|
||||
this._hashChanged();
|
||||
this.path = window.location.pathname;
|
||||
this.query = window.location.search.substring(1);
|
||||
this._dontUpdateUrl = false;
|
||||
this._updateUrl();
|
||||
},
|
||||
_getUrl: function() {
|
||||
var url = this.path;
|
||||
var query = this.query;
|
||||
if (query) {
|
||||
url += '?' + query;
|
||||
}
|
||||
if (this.hash) {
|
||||
url += '#' + this.hash;
|
||||
}
|
||||
return url;
|
||||
},
|
||||
_updateUrl: function() {
|
||||
if (this._dontUpdateUrl || !this._initialized) {
|
||||
return;
|
||||
}
|
||||
var newUrl = this._getUrl();
|
||||
var currentUrl = (
|
||||
window.location.pathname +
|
||||
window.location.search +
|
||||
window.location.hash
|
||||
);
|
||||
if (newUrl == currentUrl) {
|
||||
// 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 = window.performance.now();
|
||||
var shouldReplace =
|
||||
this._lastChangedAt + this.dwellTime > now;
|
||||
this._lastChangedAt = now;
|
||||
if (shouldReplace) {
|
||||
window.history.replaceState({}, '', fullNewUrl);
|
||||
} else {
|
||||
window.history.pushState({}, '', fullNewUrl);
|
||||
}
|
||||
this.fire('location-changed', {}, {node: window});
|
||||
},
|
||||
/**
|
||||
* A necessary evil so that links work as expected. Does its best to
|
||||
* bail out early if possible.
|
||||
*
|
||||
* @param {MouseEvent} event .
|
||||
*/
|
||||
_globalOnClick: function(event) {
|
||||
// If another event handler has stopped this event then there's nothing
|
||||
// for us to do. This can happen e.g. when there are multiple
|
||||
// iron-location elements in a page.
|
||||
if (event.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
var href = this._getSameOriginLinkHref(event);
|
||||
if (!href) {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
// If the navigation is to the current page we shouldn't add a history
|
||||
// entry or fire a change event.
|
||||
if (href === window.location.href) {
|
||||
return;
|
||||
}
|
||||
window.history.pushState({}, '', href);
|
||||
this.fire('location-changed', {}, {node: window});
|
||||
},
|
||||
/**
|
||||
* Returns the absolute URL of the link (if any) that this click event
|
||||
* is clicking on, if we can and should override the resulting full
|
||||
* page navigation. Returns null otherwise.
|
||||
*
|
||||
* @param {MouseEvent} event .
|
||||
* @return {string?} .
|
||||
*/
|
||||
_getSameOriginLinkHref: function(event) {
|
||||
// We only care about left-clicks.
|
||||
if (event.button !== 0) {
|
||||
return null;
|
||||
}
|
||||
// We don't want modified clicks, where the intent is to open the page
|
||||
// in a new tab.
|
||||
if (event.metaKey || event.ctrlKey) {
|
||||
return null;
|
||||
}
|
||||
var eventPath = Polymer.dom(event).path;
|
||||
var anchor = null;
|
||||
for (var i = 0; i < eventPath.length; i++) {
|
||||
var element = eventPath[i];
|
||||
if (element.tagName === 'A' && element.href) {
|
||||
anchor = element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no link there's nothing to do.
|
||||
if (!anchor) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Target blank is a new tab, don't intercept.
|
||||
if (anchor.target === '_blank') {
|
||||
return null;
|
||||
}
|
||||
// If the link is for an existing parent frame, don't intercept.
|
||||
if ((anchor.target === '_top' ||
|
||||
anchor.target === '_parent') &&
|
||||
window.top !== window) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var href = anchor.href;
|
||||
|
||||
// It only makes sense for us to intercept same-origin navigations.
|
||||
// pushState/replaceState don't work with cross-origin links.
|
||||
var url;
|
||||
if (document.baseURI != null) {
|
||||
url = new URL(href, /** @type {string} */(document.baseURI));
|
||||
} else {
|
||||
url = new URL(href);
|
||||
}
|
||||
|
||||
var origin;
|
||||
|
||||
// IE Polyfill
|
||||
if (window.location.origin) {
|
||||
origin = window.location.origin;
|
||||
} else {
|
||||
origin = window.location.protocol + '//' + window.location.hostname;
|
||||
|
||||
if (window.location.port) {
|
||||
origin += ':' + window.location.port;
|
||||
}
|
||||
}
|
||||
|
||||
if (url.origin !== origin) {
|
||||
return null;
|
||||
}
|
||||
var normalizedHref = url.pathname + url.search + url.hash;
|
||||
|
||||
// If we've been configured not to handle this url... don't handle it!
|
||||
if (this._urlSpaceRegExp &&
|
||||
!this._urlSpaceRegExp.test(normalizedHref)) {
|
||||
return null;
|
||||
}
|
||||
// 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);
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -1,83 +0,0 @@
|
|||
<!--
|
||||
@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
|
||||
-->
|
||||
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
|
||||
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
Polymer({
|
||||
is: 'iron-query-params',
|
||||
properties: {
|
||||
paramsString: {
|
||||
type: String,
|
||||
notify: true,
|
||||
observer: 'paramsStringChanged',
|
||||
},
|
||||
paramsObject: {
|
||||
type: Object,
|
||||
notify: true,
|
||||
value: function() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
_dontReact: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
}
|
||||
},
|
||||
hostAttributes: {
|
||||
hidden: true
|
||||
},
|
||||
observers: [
|
||||
'paramsObjectChanged(paramsObject.*)'
|
||||
],
|
||||
paramsStringChanged: function() {
|
||||
this._dontReact = true;
|
||||
this.paramsObject = this._decodeParams(this.paramsString);
|
||||
this._dontReact = false;
|
||||
},
|
||||
paramsObjectChanged: function() {
|
||||
if (this._dontReact) {
|
||||
return;
|
||||
}
|
||||
this.paramsString = this._encodeParams(this.paramsObject);
|
||||
},
|
||||
_encodeParams: function(params) {
|
||||
var encodedParams = [];
|
||||
for (var key in params) {
|
||||
var value = params[key];
|
||||
if (value === '') {
|
||||
encodedParams.push(encodeURIComponent(key));
|
||||
} else if (value) {
|
||||
encodedParams.push(
|
||||
encodeURIComponent(key) +
|
||||
'=' +
|
||||
encodeURIComponent(value.toString())
|
||||
);
|
||||
}
|
||||
}
|
||||
return encodedParams.join('&');
|
||||
},
|
||||
_decodeParams: function(paramString) {
|
||||
var params = {};
|
||||
var paramList = (paramString || '').split('&');
|
||||
for (var i = 0; i < paramList.length; i++) {
|
||||
var param = paramList[i].split('=');
|
||||
if (param[0]) {
|
||||
params[decodeURIComponent(param[0])] =
|
||||
decodeURIComponent(param[1] || '');
|
||||
}
|
||||
}
|
||||
return params;
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -1,26 +0,0 @@
|
|||
<!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>
|
||||
<meta charset="utf-8">
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
WCT.loadSuites([
|
||||
'iron-location.html',
|
||||
'iron-query-params.html',
|
||||
'initialization-tests.html'
|
||||
]);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,277 +0,0 @@
|
|||
<!--
|
||||
@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
|
||||
-->
|
||||
|
||||
<link rel='import' href='../iron-location.html'>
|
||||
<link rel='import' href='../../polymer/polymer.html'>
|
||||
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'default-value',
|
||||
properties: {
|
||||
val: {
|
||||
type: String,
|
||||
notify: true,
|
||||
value: 'default-value'
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Polymer({
|
||||
is: 'on-attached',
|
||||
properties: {
|
||||
val: {
|
||||
type: String,
|
||||
notify: true,
|
||||
value: 'on-attached-default-value'
|
||||
}
|
||||
},
|
||||
attached: function() {
|
||||
if (this.val === 'on-attached-default-value') {
|
||||
this.val = 'on-attached';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Polymer({
|
||||
is: 'on-ready',
|
||||
properties: {
|
||||
val: {
|
||||
type: String,
|
||||
notify: true,
|
||||
value: 'on-ready-default-value'
|
||||
}
|
||||
},
|
||||
ready: function() {
|
||||
this.val = 'on-ready';
|
||||
}
|
||||
});
|
||||
|
||||
Polymer({
|
||||
is: 'on-timeout',
|
||||
properties: {
|
||||
val: {
|
||||
type: String,
|
||||
notify: true,
|
||||
value: 'on-timeout-default-value'
|
||||
}
|
||||
},
|
||||
attached: function() {
|
||||
setTimeout(function() {
|
||||
this.val = 'on-timeout';
|
||||
}.bind(this), 10);
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<dom-module id='default-before'>
|
||||
<template>
|
||||
<default-value value='{{val}}'></default-value>
|
||||
<iron-location query='{{val}}'></iron-location>
|
||||
|
||||
</template>
|
||||
<script>Polymer({is: 'default-before', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='attached-before'>
|
||||
<template>
|
||||
<on-attached val='{{val}}'></on-attached>
|
||||
<iron-location query='{{val}}'></iron-location>
|
||||
</template>
|
||||
<script>Polymer({is: 'attached-before', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='ready-before'>
|
||||
<template>
|
||||
<on-ready val='{{val}}'></on-ready>
|
||||
<iron-location query='{{val}}'></iron-location>
|
||||
</template>
|
||||
<script>Polymer({is: 'ready-before', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='timeout-before'>
|
||||
<template>
|
||||
<on-timeout val='{{val}}'></on-timeout>
|
||||
<iron-location query='{{val}}'></iron-location>
|
||||
</template>
|
||||
<script>Polymer({is: 'timeout-before', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
|
||||
<dom-module id='default-after'>
|
||||
<template>
|
||||
<iron-location query='{{val}}'></iron-location>
|
||||
<default-value value='{{val}}'></default-value>
|
||||
</template>
|
||||
<script>Polymer({is: 'default-after', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='attached-after'>
|
||||
<template>
|
||||
<iron-location query='{{val}}'></iron-location>
|
||||
<on-attached val='{{val}}'></on-attached>
|
||||
</template>
|
||||
<script>Polymer({is: 'attached-after', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='ready-after'>
|
||||
<template>
|
||||
<iron-location query='{{val}}'></iron-location>
|
||||
<on-ready val='{{val}}'></on-ready>
|
||||
</template>
|
||||
<script>Polymer({is: 'ready-after', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='timeout-after'>
|
||||
<template>
|
||||
<iron-location query='{{val}}'></iron-location>
|
||||
<on-timeout val='{{val}}'></on-timeout>
|
||||
</template>
|
||||
<script>Polymer({is: 'timeout-after', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
|
||||
<dom-module id='default-below'>
|
||||
<template>
|
||||
<iron-location query='{{val}}'>
|
||||
<default-value value='{{val}}'></default-value>
|
||||
</iron-location>
|
||||
</template>
|
||||
<script>Polymer({is: 'default-below', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='attached-below'>
|
||||
<template>
|
||||
<iron-location query='{{val}}'>
|
||||
<on-attached val='{{val}}'></on-attached>
|
||||
</iron-location>
|
||||
</template>
|
||||
<script>Polymer({is: 'attached-below', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='ready-below'>
|
||||
<template>
|
||||
<iron-location query='{{val}}'>
|
||||
<on-ready val='{{val}}'></on-ready>
|
||||
</iron-location>
|
||||
</template>
|
||||
<script>Polymer({is: 'ready-below', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='timeout-below'>
|
||||
<template>
|
||||
<iron-location query='{{val}}'>
|
||||
<on-timeout val='{{val}}'></on-timeout>
|
||||
</iron-location>
|
||||
</template>
|
||||
<script>Polymer({is: 'timeout-below', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
|
||||
<dom-module id='default-above'>
|
||||
<template>
|
||||
<default-value value='{{val}}'>
|
||||
<iron-location query='{{val}}'></iron-location>
|
||||
</default-value>
|
||||
</template>
|
||||
<script>Polymer({is: 'default-above', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='attached-above'>
|
||||
<template>
|
||||
<on-attached val='{{val}}'>
|
||||
<iron-location query='{{val}}'>
|
||||
</iron-location>
|
||||
</on-attached>
|
||||
</template>
|
||||
<script>Polymer({is: 'attached-above', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='ready-above'>
|
||||
<template>
|
||||
<on-ready val='{{val}}'>
|
||||
<iron-location query='{{val}}'>
|
||||
</iron-location>
|
||||
</on-ready>
|
||||
</template>
|
||||
<script>Polymer({is: 'ready-above', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='timeout-above'>
|
||||
<template>
|
||||
<on-timeout val='{{val}}'>
|
||||
<iron-location query='{{val}}'></iron-location>
|
||||
</on-timeout>
|
||||
</template>
|
||||
<script>Polymer({is: 'timeout-above', properties: {val: {type: String}}});</script>
|
||||
</dom-module>
|
||||
|
||||
|
||||
<dom-module id='default-container'>
|
||||
<template>
|
||||
<iron-location query='{{val}}'></iron-location>
|
||||
</template>
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'default-container',
|
||||
properties: {val: {type: String, value: 'default-container-val'}}
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='attached-container'>
|
||||
<template>
|
||||
<iron-location query='{{val}}'></iron-location>
|
||||
</template>
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'attached-container',
|
||||
properties: {val: {type: String, value: 'container-attached-default-val'}},
|
||||
attached: function() {
|
||||
if (this.val === 'container-attached-default-val') {
|
||||
this.val = 'attached-container-val';
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='ready-container'>
|
||||
<template>
|
||||
<iron-location query='{{val}}'></iron-location>
|
||||
</template>
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'ready-container', properties: {val: {type: String}},
|
||||
ready: function() {
|
||||
this.val = 'ready-container-val';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='timeout-container'>
|
||||
<template>
|
||||
<iron-location query='{{val}}'></iron-location>
|
||||
</template>
|
||||
<script>Polymer({
|
||||
is: 'timeout-container',
|
||||
properties: {
|
||||
val: {
|
||||
type: String,
|
||||
notify: true
|
||||
}
|
||||
},
|
||||
attached: function() {
|
||||
setTimeout(function() {
|
||||
this.val = 'on-timeout';
|
||||
}.bind(this), 10);
|
||||
}
|
||||
});</script>
|
||||
</dom-module>
|
|
@ -1,61 +0,0 @@
|
|||
<!--
|
||||
@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
|
||||
-->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Base source for injecting into an iframe for tests</title>
|
||||
<script src="../../webcomponentsjs/webcomponents.js"></script>
|
||||
<link rel='import' href='./initialization-cases.html'>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
window.addEventListener("message", messageReceived, false);
|
||||
|
||||
window.addEventListener('WebComponentsReady', function() {
|
||||
window.parent.postMessage({
|
||||
'type': 'ready'
|
||||
}, '*');
|
||||
});
|
||||
|
||||
var appendBodyReceived = false;
|
||||
function messageReceived(msg) {
|
||||
if (!msg.data) {
|
||||
console.error('got invalid msg?');
|
||||
}
|
||||
// the parent can (at any time) ask for our URL.
|
||||
if (msg.data.type === 'urlQuery') {
|
||||
msg.source.postMessage({
|
||||
'type': 'urlQueryResponse',
|
||||
'href': window.location.href,
|
||||
'pathname': window.location.pathname,
|
||||
'hash': window.location.hash,
|
||||
'search': window.location.search
|
||||
}, '*');
|
||||
} else if (msg.data.type === 'appendBody') {
|
||||
if (appendBodyReceived) {
|
||||
throw new Error('should only receive at most one appendBody call');
|
||||
}
|
||||
var element = document.createElement(msg.data.tagName);
|
||||
document.body.appendChild(element);
|
||||
appendBodyReceived = true;
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('error', function(e) {
|
||||
window.parent.postMessage({
|
||||
'type': 'error',
|
||||
'error': e.message
|
||||
}, '*');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,145 +0,0 @@
|
|||
<!--
|
||||
@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
|
||||
-->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<script src="../../webcomponentsjs/webcomponents.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
|
||||
<link rel="import" href="../../polymer/polymer.html">
|
||||
<link rel="import" href="../../promise-polyfill/promise-polyfill.html">
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="../iron-location.html">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
function getIframe() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var iframe = document.createElement('iframe');
|
||||
var result = getMessageMatching(iframe, function(message) {
|
||||
return message.type === 'ready';
|
||||
});
|
||||
iframe.src = './initialization-iframe.html';
|
||||
document.body.appendChild(iframe);
|
||||
iframe.addEventListener('error', reject);
|
||||
result.then(function() {resolve(iframe)}, reject);
|
||||
});
|
||||
}
|
||||
|
||||
function onMessage(iframe, callback) {
|
||||
var f = function(event) {
|
||||
if (event.source === iframe.contentWindow) {
|
||||
callback(event.data);
|
||||
}
|
||||
};
|
||||
window.addEventListener('message', f, false);
|
||||
return function() {
|
||||
window.removeEventListener('message', f);
|
||||
}
|
||||
}
|
||||
|
||||
function getMessageMatching(iframe, predicate) {
|
||||
var revoke = function() {};
|
||||
var result = new Promise(function(resolve, reject) {
|
||||
revoke = onMessage(iframe, function(message) {
|
||||
if (predicate(message)) {
|
||||
resolve(message);
|
||||
}
|
||||
});
|
||||
});
|
||||
result.then(revoke, revoke);
|
||||
return result;
|
||||
}
|
||||
|
||||
function getUrl(iframe) {
|
||||
var result = getMessageMatching(iframe, function(message) {
|
||||
return message.type === 'urlQueryResponse';
|
||||
})
|
||||
var revoke = function() {};
|
||||
var result = new Promise(function(resolve, reject) {
|
||||
revoke = onMessage(iframe, resolve);
|
||||
});
|
||||
result.then(revoke, revoke);
|
||||
iframe.contentWindow.postMessage({type: 'urlQuery'}, '*');
|
||||
return result;
|
||||
}
|
||||
|
||||
function timePasses(ms) {
|
||||
return new Promise(function(resolve) {
|
||||
window.setTimeout(function() {
|
||||
resolve();
|
||||
}, ms);
|
||||
});
|
||||
}
|
||||
|
||||
suite('<iron-location>\'s initialization', function() {
|
||||
var iframe;
|
||||
var error;
|
||||
setup(function() {
|
||||
return getIframe().then(function(i) {
|
||||
iframe = i;
|
||||
function isError(m) {return m.type === 'error'}
|
||||
getMessageMatching(iframe, isError).then(function(m) {
|
||||
error = m.error;
|
||||
});
|
||||
});
|
||||
});
|
||||
teardown(function() {
|
||||
if (iframe) {
|
||||
document.body.removeChild(iframe);
|
||||
}
|
||||
var e = error;
|
||||
iframe = null;
|
||||
error = null;
|
||||
if (e) {
|
||||
throw new Error('Error message from contained iframe: ' + e);
|
||||
}
|
||||
});
|
||||
var cases = [
|
||||
'default-before', 'attached-before', 'ready-before',
|
||||
'default-after', 'attached-after', 'ready-after',
|
||||
'default-below', 'attached-below', 'ready-below',
|
||||
'default-above', 'attached-above', 'ready-above',
|
||||
'default-container', 'attached-container', 'ready-container'
|
||||
];
|
||||
cases.forEach(function(caseName) {
|
||||
test('the url takes priority in ' + caseName + ' initialization', function() {
|
||||
return getUrl(iframe).then(function(url) {
|
||||
expect(url.search).to.be.eq('');
|
||||
iframe.contentWindow.postMessage({type: 'appendBody', tagName: caseName}, '*');
|
||||
return timePasses(10).then(function() {return getUrl(iframe)});
|
||||
}).then(function(url) {
|
||||
expect(url.search).to.be.eq('');
|
||||
});
|
||||
});
|
||||
});
|
||||
var expectedFailureCases = ['timeout-before', 'timeout-after', 'timeout-below', 'timeout-above', 'timeout-container'];
|
||||
expectedFailureCases.forEach(function(caseName) {
|
||||
test('the url does not take priority in ' + caseName + ' initialization', function() {
|
||||
return getUrl(iframe).then(function(url) {
|
||||
expect(url.search).to.be.eq('');
|
||||
iframe.contentWindow.postMessage({type: 'appendBody', tagName: caseName}, '*');
|
||||
return timePasses(60).then(function() {return getUrl(iframe)});
|
||||
}).then(function(url) {
|
||||
expect(url.search).to.be.eq('?on-timeout');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,369 +0,0 @@
|
|||
<!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>iron-location</title>
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
|
||||
<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'>
|
||||
<template>
|
||||
<iron-location></iron-location>
|
||||
</template>
|
||||
</test-fixture>
|
||||
<test-fixture id='Together'>
|
||||
<template>
|
||||
<div>
|
||||
<iron-location id='one'></iron-location>
|
||||
<iron-location id='two'></iron-location>
|
||||
</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';
|
||||
|
||||
function timePasses(ms) {
|
||||
return new Promise(function(resolve) {
|
||||
window.setTimeout(function() {
|
||||
resolve();
|
||||
}, ms);
|
||||
});
|
||||
}
|
||||
|
||||
function makeAbsoluteUrl(path) {
|
||||
return window.location.protocol + '//' + window.location.host + path;
|
||||
}
|
||||
|
||||
// A window.history.replaceState wrapper that's smart about baseURI.
|
||||
function replaceState(path) {
|
||||
window.history.replaceState({}, '', makeAbsoluteUrl(path));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
urlElem = fixture('Solo');
|
||||
});
|
||||
test('basic functionality with #hash urls', function() {
|
||||
// Initialized to the window location's hash.
|
||||
expect(window.location.hash).to.be.equal(urlElem.hash);
|
||||
|
||||
// Changing the urlElem's hash changes the URL
|
||||
urlElem.hash = '/lol/ok';
|
||||
expect(window.location.hash).to.be.equal('#/lol/ok');
|
||||
|
||||
// Changing the hash via normal means changes the urlElem.
|
||||
var anchor = document.createElement('a');
|
||||
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.
|
||||
return timePasses(10).then(function() {
|
||||
expect(urlElem.hash).to.be.equal('/wat');
|
||||
});
|
||||
});
|
||||
test('basic functionality with paths', function() {
|
||||
// Initialized to the window location's path.
|
||||
expect(window.location.pathname).to.be.equal(urlElem.path);
|
||||
|
||||
// Changing the urlElem's path changes the URL
|
||||
urlElem.path = '/foo/bar';
|
||||
expect(window.location.pathname).to.be.equal('/foo/bar');
|
||||
|
||||
// Changing the path and sending a custom event on the window changes
|
||||
// the urlElem.
|
||||
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.
|
||||
replaceState('/?greeting=hello&target=world');
|
||||
window.dispatchEvent(new CustomEvent('location-changed'));
|
||||
expect(urlElem.query).to.be.equal('greeting=hello&target=world');
|
||||
|
||||
// Changing the urlElem's query changes the URL.
|
||||
urlElem.query = 'greeting=hello&target=world&another=key';
|
||||
expect(window.location.search).to.be.equal(
|
||||
'?greeting=hello&target=world&another=key');
|
||||
});
|
||||
});
|
||||
suite('does not spam the user\'s history', function() {
|
||||
var replaceStateCalls, pushStateCalls;
|
||||
var nativeReplaceState, nativePushState;
|
||||
setup(function() {
|
||||
replaceStateCalls = pushStateCalls = 0;
|
||||
nativeReplaceState = window.history.replaceState;
|
||||
nativePushState = window.history.pushState;
|
||||
window.history.replaceState = function() {
|
||||
replaceStateCalls++;
|
||||
};
|
||||
window.history.pushState = function() {
|
||||
pushStateCalls++;
|
||||
};
|
||||
});
|
||||
teardown(function() {
|
||||
window.history.replaceState = nativeReplaceState;
|
||||
window.history.pushState = nativePushState;
|
||||
});
|
||||
test('when a change happens immediately after ' +
|
||||
'the iron-location is attached', function() {
|
||||
var ironLocation = fixture('Solo');
|
||||
expect(pushStateCalls).to.be.equal(0);
|
||||
expect(replaceStateCalls).to.be.equal(0);
|
||||
ironLocation.path = '/foo';
|
||||
expect(replaceStateCalls).to.be.equal(1);
|
||||
expect(pushStateCalls).to.be.equal(0);
|
||||
});
|
||||
|
||||
suite('when intercepting links', function() {
|
||||
/**
|
||||
* Clicks the given link while an iron-location element with the given
|
||||
* urlSpaceRegex is in the same document. Returns whether the
|
||||
* iron-location prevented the default behavior of the click.
|
||||
*
|
||||
* No matter what, it prevents the default behavior of the click itself
|
||||
* to ensure that no navigation occurs (as that would interrupt
|
||||
* running and reporting these tests!)
|
||||
*/
|
||||
function isClickCaptured(anchor, urlSpaceRegex) {
|
||||
var defaultWasPrevented;
|
||||
function handler(event) {
|
||||
expect(event.target).to.be.eq(anchor);
|
||||
defaultWasPrevented = event.defaultPrevented;
|
||||
event.preventDefault();
|
||||
expect(event.defaultPrevented).to.be.eq(true);
|
||||
}
|
||||
window.addEventListener('click', handler);
|
||||
var ironLocation = fixture('Solo');
|
||||
if (urlSpaceRegex != null) {
|
||||
ironLocation.urlSpaceRegex = urlSpaceRegex;
|
||||
}
|
||||
document.body.appendChild(anchor);
|
||||
anchor.click();
|
||||
document.body.removeChild(anchor);
|
||||
window.removeEventListener('click', handler);
|
||||
return defaultWasPrevented;
|
||||
}
|
||||
|
||||
test('simple link to / is intercepted', function() {
|
||||
var anchor = document.createElement('a');
|
||||
if (document.baseURI !== window.location.href) {
|
||||
anchor.href = makeAbsoluteUrl('/');
|
||||
} else {
|
||||
anchor.href = '/';
|
||||
}
|
||||
|
||||
expect(isClickCaptured(anchor)).to.be.eq(true);
|
||||
expect(pushStateCalls).to.be.equal(1);
|
||||
});
|
||||
|
||||
test('link that matches url space is intercepted', function() {
|
||||
var anchor = document.createElement('a');
|
||||
anchor.href = makeAbsoluteUrl('/foo');
|
||||
|
||||
expect(isClickCaptured(anchor, '/fo+')).to.be.eq(true);
|
||||
expect(pushStateCalls).to.be.equal(1);
|
||||
});
|
||||
|
||||
test('link that doesn\'t match url space isn\'t intercepted', function() {
|
||||
var anchor = document.createElement('a');
|
||||
anchor.href = makeAbsoluteUrl('/bar');
|
||||
|
||||
expect(isClickCaptured(anchor, '/fo+')).to.be.eq(false);
|
||||
expect(pushStateCalls).to.be.equal(0);
|
||||
});
|
||||
|
||||
test('link to another domain isn\'t intercepted', function() {
|
||||
var anchor = document.createElement('a');
|
||||
anchor.href = 'http://example.com/';
|
||||
|
||||
expect(isClickCaptured(anchor)).to.be.eq(false);
|
||||
expect(pushStateCalls).to.be.equal(0);
|
||||
});
|
||||
|
||||
test('a link with target=_blank isn\'t intercepted', function() {
|
||||
var anchor = document.createElement('a');
|
||||
anchor.href = makeAbsoluteUrl('/');
|
||||
anchor.target = '_blank';
|
||||
|
||||
expect(isClickCaptured(anchor)).to.be.eq(false);
|
||||
expect(pushStateCalls).to.be.equal(0);
|
||||
});
|
||||
|
||||
test('a link with an href to the ' +
|
||||
'current page shouldn\'t add to history.', function() {
|
||||
var anchor = document.createElement('a');
|
||||
anchor.href = window.location.href;
|
||||
|
||||
// The click is captured, but it doesn't add to history.
|
||||
expect(isClickCaptured(anchor)).to.be.equal(true);
|
||||
expect(pushStateCalls).to.be.equal(0);
|
||||
});
|
||||
|
||||
test('a click that has already been defaultPrevented ' +
|
||||
'shouldn\'t result in a navigation', function() {
|
||||
fixture('Solo');
|
||||
var anchor = document.createElement('a');
|
||||
anchor.href = makeAbsoluteUrl('/');
|
||||
anchor.addEventListener('click', function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
document.body.appendChild(anchor);
|
||||
|
||||
var originalPushState = window.history.pushState;
|
||||
var count = 0;
|
||||
window.history.pushState = function() {
|
||||
count++;
|
||||
}
|
||||
anchor.click();
|
||||
window.history.pushState = originalPushState;
|
||||
|
||||
expect(count).to.be.equal(0);
|
||||
})
|
||||
});
|
||||
});
|
||||
suite('when used with other iron-location elements', function() {
|
||||
var otherUrlElem;
|
||||
var urlElem;
|
||||
setup(function() {
|
||||
var elems = fixture('Together');
|
||||
urlElem = elems.querySelector('#one');
|
||||
otherUrlElem = elems.querySelector('#two');
|
||||
});
|
||||
function assertHaveSameUrls(urlElemOne, urlElemTwo) {
|
||||
expect(urlElemOne.path).to.be.equal(urlElemTwo.path);
|
||||
expect(urlElemOne.hash).to.be.equal(urlElemTwo.hash);
|
||||
expect(urlElemOne.query).to.be.equal(urlElemTwo.query);
|
||||
}
|
||||
test('coordinate their changes (by firing events on window)', function() {
|
||||
assertHaveSameUrls(urlElem, otherUrlElem);
|
||||
|
||||
urlElem.path = '/a/b/c';
|
||||
assertHaveSameUrls(urlElem, otherUrlElem);
|
||||
|
||||
otherUrlElem.query = 'alsdkjflaksjfd=alksjfdlkajsdfl';
|
||||
assertHaveSameUrls(urlElem, otherUrlElem);
|
||||
|
||||
urlElem.hash = 'lkjljifosjkldfjlksjfldsjf';
|
||||
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>
|
||||
</body>
|
|
@ -1,96 +0,0 @@
|
|||
<!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>iron-location</title>
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
|
||||
<link rel="import" href="../../polymer/polymer.html">
|
||||
<link rel="import" href="../../promise-polyfill/promise-polyfill.html">
|
||||
<link rel="import" href="../iron-query-params.html">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="BasicQueryParams">
|
||||
<template>
|
||||
<iron-query-params></iron-query-params>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite('<iron-query-params>', function () {
|
||||
|
||||
var paramsElem;
|
||||
setup(function() {
|
||||
paramsElem = fixture('BasicQueryParams');
|
||||
});
|
||||
|
||||
test('basic functionality with ?key=value params', function() {
|
||||
// Check initialization
|
||||
expect(paramsElem.paramsString).to.be.eq('');
|
||||
expect(paramsElem.paramsObject).to.deep.eq({});
|
||||
|
||||
// Check the mapping from paramsString to paramsObject.
|
||||
paramsElem.paramsString = 'greeting=hello&target=world';
|
||||
expect(paramsElem.paramsObject).to.deep.equal(
|
||||
{greeting: 'hello', target: 'world'});
|
||||
|
||||
// Check the mapping from paramsObject back to paramsString.
|
||||
paramsElem.set('paramsObject.another', 'key');
|
||||
expect(paramsElem.paramsString).to.be.equal(
|
||||
'greeting=hello&target=world&another=key');
|
||||
});
|
||||
test('encoding of params', function() {
|
||||
var mappings = [
|
||||
{
|
||||
string: 'a=b',
|
||||
object: {'a': 'b'}
|
||||
},
|
||||
{
|
||||
string: 'debug&ok',
|
||||
object: {'debug': '', 'ok': ''}
|
||||
},
|
||||
{
|
||||
string: 'monster%20kid%3A=%F0%9F%98%BF',
|
||||
object: {'monster kid:': '😿'}
|
||||
},
|
||||
{
|
||||
string: 'yes%2C%20ok%3F%20what%20is%20up%20with%20%CB%9Athiiis%CB%9A=%E2%98%83',
|
||||
object: {'yes, ok? what is up with ˚thiiis˚': '☃'}
|
||||
},
|
||||
];
|
||||
|
||||
mappings.forEach(function(mapping) {
|
||||
// Clear
|
||||
paramsElem.paramsObject = {};
|
||||
expect(paramsElem.paramsString).to.be.equal('');
|
||||
|
||||
// Test going from string to object
|
||||
paramsElem.paramsString = mapping.string;
|
||||
expect(paramsElem.paramsObject).to.deep.equal(mapping.object);
|
||||
|
||||
// Clear again.
|
||||
paramsElem.paramsObject = {};
|
||||
expect(paramsElem.paramsString).to.be.equal('');
|
||||
|
||||
// Test going from object to string
|
||||
paramsElem.paramsObject = mapping.object;
|
||||
expect(paramsElem.paramsString).to.be.equal(mapping.string);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
|
@ -1,68 +0,0 @@
|
|||
<!--
|
||||
@license
|
||||
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
|
||||
-->
|
||||
<dom-module id='redirect-hash'>
|
||||
<template>
|
||||
<iron-location hash='{{hash}}'></iron-location>
|
||||
</template>
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'redirect-hash',
|
||||
properties: {
|
||||
hash: {
|
||||
value: '',
|
||||
observer: 'hashChanged'
|
||||
}
|
||||
},
|
||||
hashChanged: function(hash) {
|
||||
this.hash = 'redirectedTo';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='redirect-path'>
|
||||
<template>
|
||||
<iron-location path='{{path}}'></iron-location>
|
||||
</template>
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'redirect-path',
|
||||
properties: {
|
||||
path: {
|
||||
value: '',
|
||||
observer: 'pathChanged'
|
||||
}
|
||||
},
|
||||
pathChanged: function(path) {
|
||||
this.path = '/redirectedTo';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
||||
|
||||
<dom-module id='redirect-query'>
|
||||
<template>
|
||||
<iron-location query='{{query}}'></iron-location>
|
||||
</template>
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'redirect-query',
|
||||
properties: {
|
||||
query: {
|
||||
value: '',
|
||||
observer: 'queryChanged'
|
||||
}
|
||||
},
|
||||
queryChanged: function(query) {
|
||||
this.query = 'redirectedTo';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
|
@ -1,44 +0,0 @@
|
|||
{
|
||||
"name": "iron-pages",
|
||||
"version": "1.0.7",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Organizes a set of pages and shows one at a time",
|
||||
"main": "iron-pages.html",
|
||||
"private": true,
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-pages.git"
|
||||
},
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"container"
|
||||
],
|
||||
"dependencies": {
|
||||
"iron-resizable-behavior": "polymerelements/iron-resizable-behavior#^1.0.0",
|
||||
"iron-selector": "polymerelements/iron-selector#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
|
||||
"iron-demo-helpers": "polymerelements/iron-demo-helpers#^1.0.0",
|
||||
"paper-styles": "polymerelements/paper-styles#^1.0.2",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/PolymerElements/iron-pages",
|
||||
"_release": "1.0.7",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.7",
|
||||
"commit": "357acb8508da5093b22887a85cb785919c20cfde"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-pages.git",
|
||||
"_target": "~1.0.2",
|
||||
"_originalSource": "PolymerElements/iron-pages"
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
bower_components
|
|
@ -1,25 +0,0 @@
|
|||
language: node_js
|
||||
sudo: false
|
||||
before_script:
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
env:
|
||||
global:
|
||||
- secure: QwCi1poMu8n3s7gAljvAyODa0+zmte8B9qAO/S/SziRNDcRHJF4RRZp0HJfgVYkCaHsgCOrRswfkqZqlj4QC5goPfwtwgRtIdcEarF64kAjWLXHH66aMPSlop+MZYSJwFRrrmcc0jTDTOPw6CXaz1lYrcvpGnVAAHSNq4e9xuwA=
|
||||
- secure: PAn10VQ1AL+FpM/qj2ak7tJe0Epd/RP3FF+jb2eVBXhmUVd9+mBH7nRwYQL4n6fIGXMtJcUkl4t35nwzEegP/nrjZlIslXFT6D/273FbJcbH1SaCsnwLn3Rr0VffwaHC76yLsW7ph2/paAS4iLWS4AeP1c2dAR9zimSpM7Knovs=
|
||||
- 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"
|
|
@ -1,72 +0,0 @@
|
|||
|
||||
<!--
|
||||
This file is autogenerated based on
|
||||
https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
|
||||
|
||||
If you edit that file, it will get updated everywhere else.
|
||||
If you edit this file, your changes will get overridden :)
|
||||
-->
|
||||
# Polymer Elements
|
||||
## Guide for Contributors
|
||||
|
||||
Polymer Elements are built in the open, and the Polymer authors eagerly encourage any and all forms of community contribution. When contributing, please follow these guidelines:
|
||||
|
||||
### Filing Issues
|
||||
|
||||
**If you are filing an issue to request a feature**, please provide a clear description of the feature. It can be helpful to describe answers to the following questions:
|
||||
|
||||
1. **Who will use the feature?** _“As someone filling out a form…”_
|
||||
2. **When will they use the feature?** _“When I enter an invalid value…”_
|
||||
3. **What is the user’s goal?** _“I want to be visually notified that the value needs to be corrected…”_
|
||||
|
||||
**If you are filing an issue to report a bug**, please provide:
|
||||
|
||||
1. **A clear description of the bug and related expectations.** Consider using the following example template for reporting a bug:
|
||||
|
||||
```markdown
|
||||
The `paper-foo` element causes the page to turn pink when clicked.
|
||||
|
||||
## Expected outcome
|
||||
|
||||
The page stays the same color.
|
||||
|
||||
## Actual outcome
|
||||
|
||||
The page turns pink.
|
||||
|
||||
## Steps to reproduce
|
||||
|
||||
1. Put a `paper-foo` element in the page.
|
||||
2. Open the page in a web browser.
|
||||
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).
|
||||
|
||||
3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers.
|
||||
|
||||
### Submitting Pull Requests
|
||||
|
||||
**Before creating a pull request**, please ensure that an issue exists for the corresponding change in the pull request that you intend to make. **If an issue does not exist, please create one per the guidelines above**. The goal is to discuss the design and necessity of the proposed change with Polymer authors and community before diving into a pull request.
|
||||
|
||||
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:
|
||||
|
||||
```markdown
|
||||
(For a single issue)
|
||||
Fixes #20
|
||||
|
||||
(For multiple issues)
|
||||
Fixes #32, #40
|
||||
```
|
||||
|
||||
2. **A succinct description of the design** used to fix any related issues. For example:
|
||||
|
||||
```markdown
|
||||
This fixes #20 by removing styles that leaked which would cause the page to turn pink whenever `paper-foo` is clicked.
|
||||
```
|
||||
|
||||
3. **At least one test for each bug fixed or feature added** as part of the pull request. Pull requests that fix bugs or add features without accompanying tests will not be considered.
|
||||
|
||||
If a proposed change contains multiple commits, please [squash commits](https://www.google.com/url?q=http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request) to as few as is necessary to succinctly express the change. A Polymer author can help you squash commits, so don’t be afraid to ask us if you need help with that!
|
|
@ -1,34 +0,0 @@
|
|||
{
|
||||
"name": "iron-pages",
|
||||
"version": "1.0.7",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Organizes a set of pages and shows one at a time",
|
||||
"main": "iron-pages.html",
|
||||
"private": true,
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-pages.git"
|
||||
},
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"container"
|
||||
],
|
||||
"dependencies": {
|
||||
"iron-resizable-behavior": "polymerelements/iron-resizable-behavior#^1.0.0",
|
||||
"iron-selector": "polymerelements/iron-selector#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
|
||||
"iron-demo-helpers": "polymerelements/iron-demo-helpers#^1.0.0",
|
||||
"paper-styles": "polymerelements/paper-styles#^1.0.2",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"ignore": []
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
<!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>iron-pages demo</title>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="../../paper-styles/color.html">
|
||||
<link rel="import" href="../../iron-demo-helpers/demo-snippet.html">
|
||||
<link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html">
|
||||
<link rel="import" href="../iron-pages.html">
|
||||
|
||||
<style is="custom-style" include="demo-pages-shared-styles"></style>
|
||||
</head>
|
||||
<body unresolved>
|
||||
<div class="vertical-section-container centered">
|
||||
<h3>iron-pages shows only one of its children at a time.</h3>
|
||||
<demo-snippet>
|
||||
<template>
|
||||
<style is="custom-style">
|
||||
iron-pages {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
font-size: 50px;
|
||||
color: white;
|
||||
text-align: center;
|
||||
}
|
||||
iron-pages div {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 80px 0;
|
||||
}
|
||||
iron-pages div:nth-child(1) {
|
||||
background-color: var(--google-blue-500);
|
||||
}
|
||||
iron-pages div:nth-child(2) {
|
||||
background-color: var(--google-red-500);
|
||||
}
|
||||
iron-pages div:nth-child(3) {
|
||||
background-color: var(--google-green-500);
|
||||
}
|
||||
</style>
|
||||
<p>Click on a page to advance to the next one.</p>
|
||||
<iron-pages selected="0">
|
||||
<div>One</div>
|
||||
<div>Two</div>
|
||||
<div>Three</div>
|
||||
</iron-pages>
|
||||
<script>
|
||||
document.addEventListener('click', function(e) {
|
||||
var pages = document.querySelector('iron-pages');
|
||||
pages.selectNext();
|
||||
});
|
||||
</script>
|
||||
</template>
|
||||
</demo-snippet>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 225 126" enable-background="new 0 0 225 126" xml:space="preserve">
|
||||
<g id="background" display="none">
|
||||
<rect display="inline" fill="#B0BEC5" width="225" height="126"/>
|
||||
</g>
|
||||
<g id="label">
|
||||
</g>
|
||||
<g id="art">
|
||||
<path d="M143.3,73.6H51.7V26.7h91.6V73.6z M53.7,71.6h87.6V28.7H53.7V71.6z"/>
|
||||
<path d="M158.3,85.4H66.7V38.6h91.6V85.4z M68.7,83.4h87.6V40.6H68.7V83.4z"/>
|
||||
<path d="M172,99H80.4V52.1H172V99z M82.4,97H170V54.1H82.4V97z"/>
|
||||
<circle cx="53" cy="28" r="4"/>
|
||||
<circle cx="171" cy="98" r="4"/>
|
||||
<g id="ic_x5F_add_x0D_">
|
||||
</g>
|
||||
</g>
|
||||
<g id="Guides">
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 921 B |
|
@ -1,25 +0,0 @@
|
|||
<!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>iron-pages</title>
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<iron-component-page></iron-component-page>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,88 +0,0 @@
|
|||
<!--
|
||||
@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
|
||||
-->
|
||||
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
<link rel="import" href="../iron-resizable-behavior/iron-resizable-behavior.html">
|
||||
<link rel="import" href="../iron-selector/iron-selectable.html">
|
||||
|
||||
<!--
|
||||
`iron-pages` is used to select one of its children to show. One use is to cycle through a list of
|
||||
children "pages".
|
||||
|
||||
Example:
|
||||
|
||||
<iron-pages selected="0">
|
||||
<div>One</div>
|
||||
<div>Two</div>
|
||||
<div>Three</div>
|
||||
</iron-pages>
|
||||
|
||||
<script>
|
||||
document.addEventListener('click', function(e) {
|
||||
var pages = document.querySelector('iron-pages');
|
||||
pages.selectNext();
|
||||
});
|
||||
</script>
|
||||
|
||||
@group Iron Elements
|
||||
@hero hero.svg
|
||||
@demo demo/index.html
|
||||
-->
|
||||
|
||||
<dom-module id="iron-pages">
|
||||
|
||||
<template>
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
|
||||
:host > ::content > :not(.iron-selected) {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<content></content>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
Polymer({
|
||||
|
||||
is: 'iron-pages',
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronResizableBehavior,
|
||||
Polymer.IronSelectableBehavior
|
||||
],
|
||||
|
||||
properties: {
|
||||
|
||||
// as the selected page is the only one visible, activateEvent
|
||||
// is both non-sensical and problematic; e.g. in cases where a user
|
||||
// handler attempts to change the page and the activateEvent
|
||||
// handler immediately changes it back
|
||||
activateEvent: {
|
||||
type: String,
|
||||
value: null
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
observers: [
|
||||
'_selectedPageChanged(selected)'
|
||||
],
|
||||
|
||||
_selectedPageChanged: function(selected, old) {
|
||||
this.async(this.notifyResize);
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</dom-module>
|
|
@ -1,92 +0,0 @@
|
|||
<!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>iron-pages-attr-for-selected</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<link rel="import" href="../iron-pages.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="basic">
|
||||
<template>
|
||||
<iron-pages attr-for-selected="name" selected="page0">
|
||||
<div name="page0">Page 0</div>
|
||||
<div name="page1">Page 1</div>
|
||||
<div name="page2">Page 2</div>
|
||||
<div name="page3">Page 3</div>
|
||||
</iron-pages>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
|
||||
suite('basic', function() {
|
||||
var pages;
|
||||
|
||||
suite('honor the selected attribute', function() {
|
||||
setup(function () {
|
||||
pages = fixture('basic');
|
||||
});
|
||||
|
||||
test('selected value', function() {
|
||||
assert.equal(pages.selected, 'page0');
|
||||
});
|
||||
|
||||
test('selected item', function(done) {
|
||||
// iron-selector uses observeNodes, which is async.
|
||||
Polymer.Base.async(function() {
|
||||
assert.equal(pages.selectedItem, pages.items[0])
|
||||
done();
|
||||
}, 1);
|
||||
});
|
||||
|
||||
test('selected item is display:block and all others are display:none', function() {
|
||||
pages.items.forEach(function(p) {
|
||||
assert.equal(getComputedStyle(p).display, p == pages.selectedItem ? 'block' : 'none');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
suite('set selected attribute', function() {
|
||||
setup(function () {
|
||||
pages = fixture('basic');
|
||||
pages.selected = 'page2';
|
||||
});
|
||||
|
||||
test('selected value', function() {
|
||||
assert.equal(pages.selected, 'page2');
|
||||
});
|
||||
|
||||
test('selected item', function() {
|
||||
assert.equal(pages.selectedItem, pages.items[2]);
|
||||
});
|
||||
|
||||
test('selected item is display:block and all others are display:none', function() {
|
||||
pages.items.forEach(function(p) {
|
||||
assert.equal(getComputedStyle(p).display, p == pages.selectedItem ? 'block' : 'none');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,98 +0,0 @@
|
|||
<!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>iron-pages-basic</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<link rel="import" href="../iron-pages.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="basic">
|
||||
<template>
|
||||
<iron-pages>
|
||||
<div id="page0">Page 0</div>
|
||||
<div id="page1">Page 1</div>
|
||||
<div id="page2">Page 2</div>
|
||||
<div id="page3">Page 3</div>
|
||||
</iron-pages>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
|
||||
suite('basic', function() {
|
||||
var pages;
|
||||
|
||||
suite('defaults', function() {
|
||||
setup(function () {
|
||||
pages = fixture('basic');
|
||||
});
|
||||
|
||||
test('to nothing selected', function() {
|
||||
assert.equal(pages.selected, undefined);
|
||||
});
|
||||
|
||||
test('null activateEvent', function() {
|
||||
// `activateEvent` is not a useful feature for iron-pages and it can interfere
|
||||
// with ux; ensure iron-pages has cleared any default `activateEvent`
|
||||
assert.equal(pages.activateEvent, null);
|
||||
});
|
||||
|
||||
test('to iron-selected as selectedClass', function() {
|
||||
assert.equal(pages.selectedClass, 'iron-selected');
|
||||
});
|
||||
|
||||
test('as many items as children', function() {
|
||||
assert.equal(pages.items.length, 4);
|
||||
});
|
||||
|
||||
test('all pages are display:none', function() {
|
||||
pages.items.forEach(function(p) {
|
||||
assert.equal(getComputedStyle(p).display, 'none');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
suite('set the selected attribute', function() {
|
||||
setup(function () {
|
||||
pages = fixture('basic');
|
||||
pages.selected = 0;
|
||||
});
|
||||
|
||||
test('selected value', function() {
|
||||
assert.equal(pages.selected, '0');
|
||||
});
|
||||
|
||||
test('selected item', function() {
|
||||
assert.equal(pages.selectedItem, pages.items[0]);
|
||||
});
|
||||
|
||||
test('selected item is display:block and all others are display:none', function() {
|
||||
pages.items.forEach(function(p) {
|
||||
assert.equal(getComputedStyle(p).display, p == pages.selectedItem ? 'block' : 'none');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,34 +0,0 @@
|
|||
<!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>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title>Tests</title>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script>
|
||||
|
||||
WCT.loadSuites([
|
||||
'basic.html',
|
||||
'attr-for-selected.html',
|
||||
'basic.html?dom=shadow',
|
||||
'attr-for-selected.html?dom=shadow'
|
||||
]);
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-range-behavior",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for something with a minimum and maximum value",
|
||||
"authors": "The Polymer Authors",
|
||||
|
@ -16,7 +16,7 @@
|
|||
"url": "git://github.com/PolymerElements/iron-range-behavior.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
"polymer": "Polymer/polymer#^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
|
@ -27,11 +27,11 @@
|
|||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/PolymerElements/iron-range-behavior",
|
||||
"_release": "1.0.5",
|
||||
"_release": "1.0.6",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.5",
|
||||
"commit": "645ffc6b39ae4fb0efd23b97016a9c4aac777978"
|
||||
"tag": "v1.0.6",
|
||||
"commit": "1317604307387599725b80b63cbd293102ea2db0"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-range-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
language: node_js
|
||||
sudo: required
|
||||
before_script:
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
env:
|
||||
global:
|
||||
- secure: IsCzwFlF0UR02RUnxyo+Gk4cdZMLDOVdy3X0qE7JCe3Lo/SJXjULrJMUZmHrKV9yQTu8bke5lhJdMe/8kuO7chLekQv4AF5bR2m3x7Kg4oJGQJE30WpBWXz6XSYuwnmOINmaNqNZKil692W28LFr97N2+TxEbE64lTd5cGcgJDI=
|
||||
- secure: TmQz2J5KMg/5dOi/7VDMWIxLoHjC5K7yCQAQOkcrq9M8PTBQE2wlCVe4wb6EqfiAofBv5e4heO9B3F0EOWWp2Sasa9ZQIcs0Lg/1SU6wv5Vt9XCONu/ZLI9oqG3SJ8pMMhcexMxmygX0wsytuI6LOI3sMMpOek2cdae1ntPT9IE=
|
||||
- secure: ioGoTHzroJHO2O9B8y/xB7dsnWY+dArvRF+Dem/0Z8yTJZ/QFCeqFctQXNdj7HIm/y7ZxetVFBnxr+0HbF62qdmVkvfBzD/TaQPeXOHSyrSbR2aAQLeSwRbcUyOmmtk/q0frf1o81i3inoLjrGKieCZq7U8VF/6YyfRDhouU5/Q=
|
||||
- secure: LxoITNXWo1Vh2dOlg0I/KI/wuEaiMpNPRcg8MN6TOwy6UIKPwlpA69YZ4eLNDnuCjndQHL7Cl/TA5njubss4UeXG+L3oQMGNBEcRSHGZGxEyTZpofJp5FFK3Ja9CpaBMB7IsWAwuGPJZXM/6aoyAVipJ1et2Gbbasd5EbQYjRwc=
|
||||
node_js: stable
|
||||
addons:
|
||||
firefox: latest
|
||||
firefox: '46.0'
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
|
@ -18,6 +18,6 @@ addons:
|
|||
- google-chrome-stable
|
||||
sauce_connect: true
|
||||
script:
|
||||
- xvfb-run wct
|
||||
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
|
||||
- xvfb-run wct
|
||||
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct -s 'default'; fi
|
||||
dist: trusty
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-range-behavior",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for something with a minimum and maximum value",
|
||||
"authors": "The Polymer Authors",
|
||||
|
@ -16,7 +16,7 @@
|
|||
"url": "git://github.com/PolymerElements/iron-range-behavior.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
"polymer": "Polymer/polymer#^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
|
|
|
@ -29,6 +29,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<body unresolved>
|
||||
|
||||
<dom-module id="x-progressbar">
|
||||
<template>
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
|
@ -52,7 +53,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
|
||||
<div class="progress" horizontal center layout style$="{{_computeStyle(ratio)}}">
|
||||
<div class="progress-value"><span>{{ratio}}</span>%</div>
|
||||
</div>
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
{
|
||||
"name": "iron-resizable-behavior",
|
||||
"version": "1.0.3",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Coordinates the flow of resizeable elements",
|
||||
"private": true,
|
||||
"main": "iron-resizable-behavior.html",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"iron",
|
||||
"behavior"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-resizable-behavior.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/polymerelements/iron-resizable-behavior",
|
||||
"_release": "1.0.3",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.3",
|
||||
"commit": "dda1df6aaf452aedf3e52ff0cf69e72439452216"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-resizable-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "polymerelements/iron-resizable-behavior"
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
bower_components
|
|
@ -1,25 +0,0 @@
|
|||
language: node_js
|
||||
sudo: false
|
||||
before_script:
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
env:
|
||||
global:
|
||||
- secure: fs6PoLBRc5z3vn6PWJTkxmGWTHnHVcXx2c7sb7wUlLFLjWUegb93X5gAUhAQvvLvFYT8uMYxT7sNsP15O16CH9OWS8h6ZbgaPp61zRJXvGN+pOtohOloanjzANzsYNFsV3LKEFg8/BULqQAKkRAdsg4hXfMWDzPvCGl1++y5mGc=
|
||||
- secure: gm+c5R0tFY/GJfKOnfV3J0IADe7QSzo5wZvRq4wZnroK9gBixuI66fq0dhRFtMjkc3dip1h+iqwmRqY8bKoMriCcl8J8ya7mG92sUTz57H7Sr6hxoYDdT4v+JUrQ+iZmTczh77IAQDZrAnxQIeEnBsLezidZD4b+EAYCICvL9WE=
|
||||
- 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"
|
|
@ -1,77 +0,0 @@
|
|||
|
||||
<!--
|
||||
This file is autogenerated based on
|
||||
https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
|
||||
|
||||
If you edit that file, it will get updated everywhere else.
|
||||
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
|
||||
## Guide for Contributors
|
||||
|
||||
Polymer Elements are built in the open, and the Polymer authors eagerly encourage any and all forms of community contribution. When contributing, please follow these guidelines:
|
||||
|
||||
### Filing Issues
|
||||
|
||||
**If you are filing an issue to request a feature**, please provide a clear description of the feature. It can be helpful to describe answers to the following questions:
|
||||
|
||||
1. **Who will use the feature?** _“As someone filling out a form…”_
|
||||
2. **When will they use the feature?** _“When I enter an invalid value…”_
|
||||
3. **What is the user’s goal?** _“I want to be visually notified that the value needs to be corrected…”_
|
||||
|
||||
**If you are filing an issue to report a bug**, please provide:
|
||||
|
||||
1. **A clear description of the bug and related expectations.** Consider using the following example template for reporting a bug:
|
||||
|
||||
```markdown
|
||||
The `paper-foo` element causes the page to turn pink when clicked.
|
||||
|
||||
## Expected outcome
|
||||
|
||||
The page stays the same color.
|
||||
|
||||
## Actual outcome
|
||||
|
||||
The page turns pink.
|
||||
|
||||
## Steps to reproduce
|
||||
|
||||
1. Put a `paper-foo` element in the page.
|
||||
2. Open the page in a web browser.
|
||||
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: [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.
|
||||
|
||||
### Submitting Pull Requests
|
||||
|
||||
**Before creating a pull request**, please ensure that an issue exists for the corresponding change in the pull request that you intend to make. **If an issue does not exist, please create one per the guidelines above**. The goal is to discuss the design and necessity of the proposed change with Polymer authors and community before diving into a pull request.
|
||||
|
||||
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 in the pull request description using the following syntax:
|
||||
|
||||
```markdown
|
||||
(For a single issue)
|
||||
Fixes #20
|
||||
|
||||
(For multiple issues)
|
||||
Fixes #32, fixes #40
|
||||
```
|
||||
|
||||
2. **A succinct description of the design** used to fix any related issues. For example:
|
||||
|
||||
```markdown
|
||||
This fixes #20 by removing styles that leaked which would cause the page to turn pink whenever `paper-foo` is clicked.
|
||||
```
|
||||
|
||||
3. **At least one test for each bug fixed or feature added** as part of the pull request. Pull requests that fix bugs or add features without accompanying tests will not be considered.
|
||||
|
||||
If a proposed change contains multiple commits, please [squash commits](https://www.google.com/url?q=http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request) to as few as is necessary to succinctly express the change. A Polymer author can help you squash commits, so don’t be afraid to ask us if you need help with that!
|
|
@ -1,31 +0,0 @@
|
|||
{
|
||||
"name": "iron-resizable-behavior",
|
||||
"version": "1.0.3",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Coordinates the flow of resizeable elements",
|
||||
"private": true,
|
||||
"main": "iron-resizable-behavior.html",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"iron",
|
||||
"behavior"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-resizable-behavior.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"ignore": []
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
<!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>iron-resizable-behavior demo</title>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="src/x-app.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<x-app></x-app>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,114 +0,0 @@
|
|||
<!--
|
||||
@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
|
||||
-->
|
||||
|
||||
<link rel="import" href="../../iron-resizable-behavior.html">
|
||||
|
||||
<dom-module id="x-puck">
|
||||
|
||||
<style>
|
||||
|
||||
:host {
|
||||
display: inline-block;
|
||||
border: 3px solid lightblue;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
|
||||
<b>I'm a resize-aware, thirdifying puck at (<span>{{x}}</span> x <span>{{y}}</span>).</b>
|
||||
|
||||
</template>
|
||||
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
|
||||
Polymer({
|
||||
|
||||
is: 'x-puck',
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronResizableBehavior
|
||||
],
|
||||
|
||||
properties: {
|
||||
x: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
|
||||
y: {
|
||||
type: Number,
|
||||
value: 0
|
||||
}
|
||||
},
|
||||
|
||||
listeners: {
|
||||
'iron-resize': '_onIronResize'
|
||||
},
|
||||
|
||||
attached: function() {
|
||||
this.async(this.notifyResize, 1);
|
||||
},
|
||||
|
||||
get parent() {
|
||||
if (this.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
|
||||
return this.parentNode.host;
|
||||
}
|
||||
|
||||
return this.parentNode;
|
||||
},
|
||||
|
||||
_onIronResize: function() {
|
||||
var x = this.x = Math.floor(this.parent.offsetWidth / 3);
|
||||
var y = this.y = Math.floor(this.parent.offsetHeight / 3);
|
||||
|
||||
this.translate3d(x + 'px', y + 'px', 0);
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<dom-module id="x-app">
|
||||
|
||||
<style>
|
||||
|
||||
:host {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
|
||||
<x-puck></x-puck>
|
||||
|
||||
</template>
|
||||
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
|
||||
Polymer({
|
||||
|
||||
is: 'x-app',
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronResizableBehavior
|
||||
]
|
||||
});
|
||||
|
||||
</script>
|
|
@ -1,25 +0,0 @@
|
|||
<!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>iron-resizable-behavior</title>
|
||||
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<iron-component-page></iron-component-page>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,195 +0,0 @@
|
|||
<!--
|
||||
@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
|
||||
-->
|
||||
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
|
||||
<script>
|
||||
/**
|
||||
* `IronResizableBehavior` is a behavior that can be used in Polymer elements to
|
||||
* coordinate the flow of resize events between "resizers" (elements that control the
|
||||
* size or hidden state of their children) and "resizables" (elements that need to be
|
||||
* notified when they are resized or un-hidden by their parents in order to take
|
||||
* action on their new measurements).
|
||||
*
|
||||
* Elements that perform measurement should add the `IronResizableBehavior` behavior to
|
||||
* their element definition and listen for the `iron-resize` event on themselves.
|
||||
* This event will be fired when they become showing after having been hidden,
|
||||
* when they are resized explicitly by another resizable, or when the window has been
|
||||
* resized.
|
||||
*
|
||||
* Note, the `iron-resize` event is non-bubbling.
|
||||
*
|
||||
* @polymerBehavior Polymer.IronResizableBehavior
|
||||
* @demo demo/index.html
|
||||
**/
|
||||
Polymer.IronResizableBehavior = {
|
||||
properties: {
|
||||
/**
|
||||
* The closest ancestor element that implements `IronResizableBehavior`.
|
||||
*/
|
||||
_parentResizable: {
|
||||
type: Object,
|
||||
observer: '_parentResizableChanged'
|
||||
},
|
||||
|
||||
/**
|
||||
* True if this element is currently notifying its descedant elements of
|
||||
* resize.
|
||||
*/
|
||||
_notifyingDescendant: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
}
|
||||
},
|
||||
|
||||
listeners: {
|
||||
'iron-request-resize-notifications': '_onIronRequestResizeNotifications'
|
||||
},
|
||||
|
||||
created: function() {
|
||||
// We don't really need property effects on these, and also we want them
|
||||
// to be created before the `_parentResizable` observer fires:
|
||||
this._interestedResizables = [];
|
||||
this._boundNotifyResize = this.notifyResize.bind(this);
|
||||
},
|
||||
|
||||
attached: function() {
|
||||
this.fire('iron-request-resize-notifications', null, {
|
||||
node: this,
|
||||
bubbles: true,
|
||||
cancelable: true
|
||||
});
|
||||
|
||||
if (!this._parentResizable) {
|
||||
window.addEventListener('resize', this._boundNotifyResize);
|
||||
this.notifyResize();
|
||||
}
|
||||
},
|
||||
|
||||
detached: function() {
|
||||
if (this._parentResizable) {
|
||||
this._parentResizable.stopResizeNotificationsFor(this);
|
||||
} else {
|
||||
window.removeEventListener('resize', this._boundNotifyResize);
|
||||
}
|
||||
|
||||
this._parentResizable = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Can be called to manually notify a resizable and its descendant
|
||||
* resizables of a resize change.
|
||||
*/
|
||||
notifyResize: function() {
|
||||
if (!this.isAttached) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._interestedResizables.forEach(function(resizable) {
|
||||
if (this.resizerShouldNotify(resizable)) {
|
||||
this._notifyDescendant(resizable);
|
||||
}
|
||||
}, this);
|
||||
|
||||
this._fireResize();
|
||||
},
|
||||
|
||||
/**
|
||||
* Used to assign the closest resizable ancestor to this resizable
|
||||
* if the ancestor detects a request for notifications.
|
||||
*/
|
||||
assignParentResizable: function(parentResizable) {
|
||||
this._parentResizable = parentResizable;
|
||||
},
|
||||
|
||||
/**
|
||||
* Used to remove a resizable descendant from the list of descendants
|
||||
* that should be notified of a resize change.
|
||||
*/
|
||||
stopResizeNotificationsFor: function(target) {
|
||||
var index = this._interestedResizables.indexOf(target);
|
||||
|
||||
if (index > -1) {
|
||||
this._interestedResizables.splice(index, 1);
|
||||
this.unlisten(target, 'iron-resize', '_onDescendantIronResize');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* This method can be overridden to filter nested elements that should or
|
||||
* should not be notified by the current element. Return true if an element
|
||||
* should be notified, or false if it should not be notified.
|
||||
*
|
||||
* @param {HTMLElement} element A candidate descendant element that
|
||||
* implements `IronResizableBehavior`.
|
||||
* @return {boolean} True if the `element` should be notified of resize.
|
||||
*/
|
||||
resizerShouldNotify: function(element) { return true; },
|
||||
|
||||
_onDescendantIronResize: function(event) {
|
||||
if (this._notifyingDescendant) {
|
||||
event.stopPropagation();
|
||||
return;
|
||||
}
|
||||
|
||||
// NOTE(cdata): In ShadowDOM, event retargetting makes echoing of the
|
||||
// otherwise non-bubbling event "just work." We do it manually here for
|
||||
// the case where Polymer is not using shadow roots for whatever reason:
|
||||
if (!Polymer.Settings.useShadow) {
|
||||
this._fireResize();
|
||||
}
|
||||
},
|
||||
|
||||
_fireResize: function() {
|
||||
this.fire('iron-resize', null, {
|
||||
node: this,
|
||||
bubbles: false
|
||||
});
|
||||
},
|
||||
|
||||
_onIronRequestResizeNotifications: function(event) {
|
||||
var target = event.path ? event.path[0] : event.target;
|
||||
|
||||
if (target === this) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._interestedResizables.indexOf(target) === -1) {
|
||||
this._interestedResizables.push(target);
|
||||
this.listen(target, 'iron-resize', '_onDescendantIronResize');
|
||||
}
|
||||
|
||||
target.assignParentResizable(this);
|
||||
this._notifyDescendant(target);
|
||||
|
||||
event.stopPropagation();
|
||||
},
|
||||
|
||||
_parentResizableChanged: function(parentResizable) {
|
||||
if (parentResizable) {
|
||||
window.removeEventListener('resize', this._boundNotifyResize);
|
||||
}
|
||||
},
|
||||
|
||||
_notifyDescendant: function(descendant) {
|
||||
// NOTE(cdata): In IE10, attached is fired on children first, so it's
|
||||
// important not to notify them if the parent is not attached yet (or
|
||||
// else they will get redundantly notified when the parent attaches).
|
||||
if (!this.isAttached) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._notifyingDescendant = true;
|
||||
descendant.notifyResize();
|
||||
this._notifyingDescendant = false;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -1,223 +0,0 @@
|
|||
<!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>iron-resizable-behavior tests</title>
|
||||
<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-resizable-behavior.html">
|
||||
<link rel="import" href="test-elements.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!--
|
||||
|
||||
Notes on Polyfill compatibility in tests:
|
||||
- Test elements loaded via imports, to ensure load order correctness
|
||||
w.r.t. Polymer.mixin being availbale
|
||||
- Resize notifications and asserts are done asynchronously, since
|
||||
there are timing differences w.r.t. when detached callbacks occur
|
||||
|
||||
-->
|
||||
|
||||
<test-fixture id="TestElement">
|
||||
<template>
|
||||
<test-element></test-element>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
suite('iron-resizable-behavior', function() {
|
||||
function ListenForResize(el, expectsResize) {
|
||||
var listener = function(event) {
|
||||
var target = event.path ? event.path[0] : event.target;
|
||||
pendingNotifications--;
|
||||
};
|
||||
|
||||
if (expectsResize !== false) {
|
||||
pendingNotifications++;
|
||||
}
|
||||
|
||||
el.addEventListener('iron-resize', listener);
|
||||
|
||||
return {
|
||||
el: el,
|
||||
remove: function() {
|
||||
el.removeEventListener('iron-resize', listener);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function RemoveListeners(listeners) {
|
||||
listeners.forEach(function(listener) {
|
||||
listener.remove();
|
||||
});
|
||||
}
|
||||
|
||||
var pendingNotifications;
|
||||
var testEl;
|
||||
|
||||
setup(function() {
|
||||
pendingNotifications = 0;
|
||||
testEl = fixture('TestElement');
|
||||
});
|
||||
|
||||
suite('x-resizer-parent', function() {
|
||||
|
||||
test('notify resizables from window', function() {
|
||||
var listeners = [
|
||||
ListenForResize(testEl.$.parent),
|
||||
ListenForResize(testEl.$.child1a),
|
||||
ListenForResize(testEl.$.child1b),
|
||||
ListenForResize(testEl.$.shadow1c.$.resizable),
|
||||
ListenForResize(testEl.$.shadow1d.$.resizable)
|
||||
];
|
||||
|
||||
window.dispatchEvent(new CustomEvent('resize', { bubbles: false }));
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
|
||||
RemoveListeners(listeners);
|
||||
});
|
||||
|
||||
test('notify resizables from parent', function() {
|
||||
var listeners = [
|
||||
ListenForResize(testEl.$.parent),
|
||||
ListenForResize(testEl.$.child1a),
|
||||
ListenForResize(testEl.$.child1b),
|
||||
ListenForResize(testEl.$.shadow1c.$.resizable),
|
||||
ListenForResize(testEl.$.shadow1d.$.resizable)
|
||||
];
|
||||
|
||||
testEl.$.parent.notifyResize();
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
RemoveListeners(listeners);
|
||||
});
|
||||
|
||||
test('detach resizables then notify parent', function() {
|
||||
sinon.spy(testEl.$.child1a, 'notifyResize');
|
||||
sinon.spy(testEl.$.shadow1c.$.resizable, 'notifyResize');
|
||||
sinon.spy(testEl.$.child1b, 'notifyResize');
|
||||
sinon.spy(testEl.$.shadow1d.$.resizable, 'notifyResize');
|
||||
|
||||
var firstElementToRemove = testEl.$.child1a;
|
||||
var firstElementParent = Polymer.dom(firstElementToRemove).parentNode;
|
||||
var secondElementToRemove = testEl.$.shadow1c.$.resizable;
|
||||
var secondElementParent = Polymer.dom(secondElementToRemove).parentNode;
|
||||
|
||||
Polymer.dom(firstElementParent).removeChild(firstElementToRemove);
|
||||
Polymer.dom(secondElementParent).removeChild(secondElementToRemove);
|
||||
|
||||
Polymer.dom.flush();
|
||||
|
||||
testEl.$.parent.notifyResize();
|
||||
|
||||
expect(testEl.$.child1a.notifyResize.callCount).to.be.equal(0);
|
||||
expect(testEl.$.shadow1c.$.resizable.notifyResize.callCount).to.be.equal(0);
|
||||
expect(testEl.$.child1b.notifyResize.callCount).to.be.equal(1);
|
||||
expect(testEl.$.shadow1d.$.resizable.notifyResize.callCount).to.be.equal(1);
|
||||
});
|
||||
|
||||
test('detach parent then notify window', function(done) {
|
||||
var listeners = [
|
||||
ListenForResize(testEl.$.parent, false),
|
||||
ListenForResize(testEl.$.child1a, false),
|
||||
ListenForResize(testEl.$.child1b, false),
|
||||
ListenForResize(testEl.$.shadow1c.$.resizable, false),
|
||||
ListenForResize(testEl.$.shadow1d.$.resizable, false)
|
||||
];
|
||||
|
||||
var el = Polymer.dom(testEl.root).querySelector('#parent');
|
||||
|
||||
el.parentNode.removeChild(el);
|
||||
|
||||
setTimeout(function() {
|
||||
try {
|
||||
window.dispatchEvent(new CustomEvent('resize', { bubbles: false }));
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
RemoveListeners(listeners);
|
||||
done();
|
||||
} catch (e) {
|
||||
done(e);
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
suite('x-resizer-parent-filtered', function() {
|
||||
|
||||
test('notify resizables from window', function() {
|
||||
var listeners = [
|
||||
ListenForResize(testEl.$.parentFiltered),
|
||||
ListenForResize(testEl.$.child2a),
|
||||
ListenForResize(testEl.$.child2b, false),
|
||||
ListenForResize(testEl.$.shadow2c.$.resizable, false),
|
||||
ListenForResize(testEl.$.shadow2d.$.resizable, false)
|
||||
];
|
||||
|
||||
testEl.$.parentFiltered.active = testEl.$.child2a;
|
||||
|
||||
window.dispatchEvent(new CustomEvent('resize', { bubbles: false }));
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
RemoveListeners(listeners);
|
||||
});
|
||||
|
||||
test('notify resizables from parent', function() {
|
||||
var listeners = [
|
||||
ListenForResize(testEl.$.parentFiltered),
|
||||
ListenForResize(testEl.$.child2a),
|
||||
ListenForResize(testEl.$.child2b, false),
|
||||
ListenForResize(testEl.$.shadow2c.$.resizable, false),
|
||||
ListenForResize(testEl.$.shadow2d.$.resizable, false)
|
||||
];
|
||||
|
||||
testEl.$.parentFiltered.active = testEl.$.child2a;
|
||||
|
||||
testEl.$.parentFiltered.notifyResize();
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
RemoveListeners(listeners);
|
||||
});
|
||||
|
||||
test('detach resizables then notify parent', function() {
|
||||
var listeners = [
|
||||
ListenForResize(testEl.$.parentFiltered),
|
||||
ListenForResize(testEl.$.child2a, false),
|
||||
ListenForResize(testEl.$.child2b, false),
|
||||
ListenForResize(testEl.$.shadow2c.$.resizable, false),
|
||||
ListenForResize(testEl.$.shadow2d.$.resizable)
|
||||
];
|
||||
|
||||
var el = Polymer.dom(testEl.root).querySelector('#child2a');
|
||||
el.parentNode.removeChild(el);
|
||||
el = Polymer.dom(testEl.root).querySelector('#shadow2c');
|
||||
el.parentNode.removeChild(el);
|
||||
|
||||
testEl.$.parentFiltered.active = testEl.$.shadow2d.$.resizable;
|
||||
|
||||
testEl.$.parentFiltered.notifyResize();
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
RemoveListeners(listeners);
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,29 +0,0 @@
|
|||
<!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>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title>Tests</title>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script>
|
||||
WCT.loadSuites([
|
||||
'basic.html',
|
||||
'iron-resizable-behavior.html',
|
||||
'basic.html?dom=shadow',
|
||||
'iron-resizable-behavior.html?dom=shadow'
|
||||
]);
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</body></html>
|
|
@ -1,88 +0,0 @@
|
|||
<!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>iron-resizable-behavior tests</title>
|
||||
<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-resizable-behavior.html">
|
||||
<link rel="import" href="test-elements.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="ResizableAndShadowBoundaries">
|
||||
<template>
|
||||
<x-light-resizable></x-light-resizable>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
|
||||
suite('iron-resizable-behavior', function() {
|
||||
var resizable;
|
||||
|
||||
suite('events across shadow boundaries', function() {
|
||||
setup(function() {
|
||||
resizable = fixture('ResizableAndShadowBoundaries');
|
||||
});
|
||||
|
||||
suite('ancestor\'s iron-resize', function() {
|
||||
test('only fires once for a notifying shadow descendent', function() {
|
||||
resizable.$.childResizable1.notifyResize();
|
||||
|
||||
expect(resizable.ironResizeCount).to.be.equal(2);
|
||||
});
|
||||
|
||||
test('only fires once when notifying descendent observables', function() {
|
||||
resizable.notifyResize();
|
||||
|
||||
expect(resizable.ironResizeCount).to.be.equal(2);
|
||||
});
|
||||
});
|
||||
|
||||
suite('descendant\'s iron-resize', function() {
|
||||
test('only fires once for a notifying shadow root', function() {
|
||||
resizable.notifyResize();
|
||||
|
||||
expect(resizable.$.childResizable1.ironResizeCount).to.be.equal(2);
|
||||
expect(resizable.$.childResizable2.ironResizeCount).to.be.equal(2);
|
||||
});
|
||||
|
||||
test('only fires once for a notifying descendent observable', function() {
|
||||
resizable.$.childResizable1.notifyResize();
|
||||
|
||||
expect(resizable.$.childResizable1.ironResizeCount).to.be.equal(2);
|
||||
});
|
||||
});
|
||||
|
||||
suite('window\'s resize', function() {
|
||||
test('causes all iron-resize events to fire once', function() {
|
||||
window.dispatchEvent(new CustomEvent('resize'));
|
||||
Polymer.dom.flush();
|
||||
expect(resizable.ironResizeCount).to.be.equal(2);
|
||||
expect(resizable.$.childResizable1.ironResizeCount).to.be.equal(2);
|
||||
expect(resizable.$.childResizable2.ironResizeCount).to.be.equal(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,193 +0,0 @@
|
|||
<!--
|
||||
@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
|
||||
-->
|
||||
<link rel="import" href="../iron-resizable-behavior.html">
|
||||
|
||||
<script>
|
||||
|
||||
Polymer({
|
||||
|
||||
is: 'x-resizer-parent',
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronResizableBehavior
|
||||
],
|
||||
|
||||
listeners: {
|
||||
'core-resize': 'resizeHandler'
|
||||
},
|
||||
|
||||
resizeHandler: function() {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
Polymer({
|
||||
|
||||
is: 'x-resizer-parent-filtered',
|
||||
|
||||
active: null,
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronResizableBehavior
|
||||
],
|
||||
|
||||
listeners: {
|
||||
'core-resize': 'resizeHandler'
|
||||
},
|
||||
|
||||
resizeHandler: function() {
|
||||
},
|
||||
|
||||
resizerShouldNotify: function(el) {
|
||||
return (el == this.active);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
Polymer({
|
||||
|
||||
is: 'x-resizable',
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronResizableBehavior
|
||||
],
|
||||
|
||||
listeners: {
|
||||
'core-resize': 'resizeHandler'
|
||||
},
|
||||
|
||||
resizeHandler: function() {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<dom-module id="x-resizable-in-shadow">
|
||||
|
||||
<template>
|
||||
|
||||
<div>
|
||||
<x-resizable id="resizable"></x-resizable>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
|
||||
Polymer({
|
||||
|
||||
is: 'x-resizable-in-shadow'
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<dom-module id='test-element'>
|
||||
|
||||
<template>
|
||||
|
||||
<!-- Normal resizable parent with child resizables -->
|
||||
<x-resizer-parent id="parent">
|
||||
<x-resizable id="child1a"></x-resizable>
|
||||
<div>
|
||||
<x-resizable id="child1b"></x-resizable>
|
||||
</div>
|
||||
<x-resizable-in-shadow id="shadow1c"></x-resizable-in-shadow>
|
||||
<div>
|
||||
<x-resizable-in-shadow id="shadow1d"></x-resizable-in-shadow>
|
||||
</div>
|
||||
</x-resizer-parent>
|
||||
|
||||
<!-- Resizable parent using resizerShouldNotify, with child resizables -->
|
||||
<x-resizer-parent-filtered id="parentFiltered">
|
||||
<x-resizable id="child2a"></x-resizable>
|
||||
<div>
|
||||
<x-resizable id="child2b"></x-resizable>
|
||||
</div>
|
||||
<x-resizable-in-shadow id="shadow2c"></x-resizable-in-shadow>
|
||||
<div>
|
||||
<x-resizable-in-shadow id="shadow2d"></x-resizable-in-shadow>
|
||||
</div>
|
||||
</x-resizer-parent-filtered>
|
||||
|
||||
</template>
|
||||
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
|
||||
Polymer({
|
||||
|
||||
is: 'test-element'
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<script>
|
||||
Polymer.ObserveIronResizeBehavior = {
|
||||
properties: {
|
||||
ironResizeCount: {
|
||||
type: Number,
|
||||
value: 0
|
||||
}
|
||||
},
|
||||
|
||||
listeners: {
|
||||
'iron-resize': '_incrementIronResizeCount'
|
||||
},
|
||||
|
||||
_incrementIronResizeCount: function() {
|
||||
this.ironResizeCount++;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<dom-module id="x-shadow-resizable">
|
||||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
</dom-module>
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'x-shadow-resizable',
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronResizableBehavior,
|
||||
Polymer.ObserveIronResizeBehavior
|
||||
]
|
||||
});
|
||||
</script>
|
||||
|
||||
<dom-module id="x-light-resizable">
|
||||
<template>
|
||||
<x-shadow-resizable id="childResizable1"></x-shadow-resizable>
|
||||
<x-shadow-resizable id="childResizable2"></x-shadow-resizable>
|
||||
</template>
|
||||
</dom-module>
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'x-light-resizable',
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronResizableBehavior,
|
||||
Polymer.ObserveIronResizeBehavior
|
||||
]
|
||||
});
|
||||
</script>
|
|
@ -1,40 +0,0 @@
|
|||
{
|
||||
"name": "iron-scroll-target-behavior",
|
||||
"version": "1.0.6",
|
||||
"description": "Allows to define a scroller target",
|
||||
"private": true,
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"main": "iron-scroll-target-behavior.html",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"scroll"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-scroll-target-behavior.git"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-scroll-target-behavior",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"_release": "1.0.6",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.6",
|
||||
"commit": "33d5864e0557212eb530dbac280bfc4b4d923880"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-scroll-target-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "PolymerElements/iron-scroll-target-behavior"
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
bower_components
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
language: node_js
|
||||
node_js: stable
|
||||
addons:
|
||||
firefox: latest
|
||||
sauce_connect: true
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- google-chrome-stable
|
||||
- g++-4.8
|
||||
before_script:
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
script:
|
||||
- xvfb-run wct
|
||||
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct -s 'default'; fi
|
||||
env:
|
||||
global:
|
||||
- CXX=g++-4.8
|
||||
- secure: V9/FfFlrGgmgHI8icv3zjSn2bupGJs3FG2KlCqBwK5irWVU3Kcshl8XnXordLIfu2UF4Q/Aa4PkD2jKNuX/jSgGPpAfAi7aOruURSMZCzPErzKTQRg8iqHovhqDyJ2d5TypCRPCYDp+nO1ZQdPT5GQ1/8EZgilZFNVNTZ9twUJIYqPEcyQ7eAlxynDgjKxhMLa04UnUXzHVZ200x09gqGXByAK6tHvzf/W3BtjmjX7BZp0CWWk7tBgiH9gBsqwaYwHG7hg+hCVsnywN6G2WsUpPM4tBu3iyiVuNDuhY07MrV1uxEW9NCjyK8GUpHuCVN9A4CxeeDJM4xR8A3JUaVvWRwhES6KJ4YEdjfU6W759o2e05Sw3q3k4YQD96xiRz5YXYrnqLvm75trLY75pWqzIQkh+6g/C/ZBxRndh/n1VrV35GtAN+KEPE733PLvE8+yUWSiSAo052GyiYqt82joZv8+a1E38jg+bWRAYGuKcYxB5zS7xCEfkoztCuBT80yR+daQGyv0q61jmDrCUgl4B2m3xNf0+C08hYhR7KPHrMzIov3LTgJhHt6oonFs21Oa9cO8moMgaXP7Az8Y4c4Bg/BXaUe6lKkZ19kyzuDbF7hFKY0ABt1SwwkHZkEJ/Bk95CJigauFOuR3rq4TW4+M1DyqebvoyzjF4H1rHBY+lo=
|
||||
- secure: x0Lq3topCMeNImNyY7nKiVPUEaQHjmywaen23pqH5/slsYrmMEFUEME+2sigGDuSacmhfka7DZuXs7jZuk6DlZN5HoueW+xwF6MxnGJRibTw6yFj6g3MJ0dDD6wu3w9TVERNiWCJ5drnTH41QwvUjGMtBrJuHw6qaiCuuLzbwqCxkRynEjssOXzsYY4JlC3EgM2/BVZQ1H2lyWH+elmRXOGDADzm8BVGQkJWCj644HROvGc45j2cOP+vq5MvL1SEA4IDdRRYGOhcc9lGZUY/qOfsai2K0LzgIvMQbjAdt8kbcvz8cnCVJHreIJKQfNe7VAWFiXhNbbzGrYH4DGe52MRSM6c22oLWqzgctqF1YDYAPAoF+6Cj6HqzHmMyNAe4RkpAGnXw5V4HjX013BFYCdImMHF6Am8I2RW2q+buWWW9fZVFjKGD0woz3ay5W4jw6Z//V73J6p/jDiVgq0MT2S4Q8hCEh8QaqK69v9eS+Vxbh1KRUvFaBJvgDYfTnTQ4niuT/Y7TV0ZQ/DMAZ/kBfyMLAmyU5XWuGAnmg6uydE5JtHJHKYb+BKyZ++uImhyfM+bQkp6PxWRNxKsgNt8dcYn50/ppNnkHjXpoQxAlR5kjjiHsVmo4ZLOxkckjyr074Kb/nmDOqMxbRzdTlsBBqycJZjKtm4YX+GkrQXsEbg8=
|
|
@ -1,77 +0,0 @@
|
|||
|
||||
<!--
|
||||
This file is autogenerated based on
|
||||
https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
|
||||
|
||||
If you edit that file, it will get updated everywhere else.
|
||||
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
|
||||
## Guide for Contributors
|
||||
|
||||
Polymer Elements are built in the open, and the Polymer authors eagerly encourage any and all forms of community contribution. When contributing, please follow these guidelines:
|
||||
|
||||
### Filing Issues
|
||||
|
||||
**If you are filing an issue to request a feature**, please provide a clear description of the feature. It can be helpful to describe answers to the following questions:
|
||||
|
||||
1. **Who will use the feature?** _“As someone filling out a form…”_
|
||||
2. **When will they use the feature?** _“When I enter an invalid value…”_
|
||||
3. **What is the user’s goal?** _“I want to be visually notified that the value needs to be corrected…”_
|
||||
|
||||
**If you are filing an issue to report a bug**, please provide:
|
||||
|
||||
1. **A clear description of the bug and related expectations.** Consider using the following example template for reporting a bug:
|
||||
|
||||
```markdown
|
||||
The `paper-foo` element causes the page to turn pink when clicked.
|
||||
|
||||
## Expected outcome
|
||||
|
||||
The page stays the same color.
|
||||
|
||||
## Actual outcome
|
||||
|
||||
The page turns pink.
|
||||
|
||||
## Steps to reproduce
|
||||
|
||||
1. Put a `paper-foo` element in the page.
|
||||
2. Open the page in a web browser.
|
||||
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: [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.
|
||||
|
||||
### Submitting Pull Requests
|
||||
|
||||
**Before creating a pull request**, please ensure that an issue exists for the corresponding change in the pull request that you intend to make. **If an issue does not exist, please create one per the guidelines above**. The goal is to discuss the design and necessity of the proposed change with Polymer authors and community before diving into a pull request.
|
||||
|
||||
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 in the pull request description using the following syntax:
|
||||
|
||||
```markdown
|
||||
(For a single issue)
|
||||
Fixes #20
|
||||
|
||||
(For multiple issues)
|
||||
Fixes #32, fixes #40
|
||||
```
|
||||
|
||||
2. **A succinct description of the design** used to fix any related issues. For example:
|
||||
|
||||
```markdown
|
||||
This fixes #20 by removing styles that leaked which would cause the page to turn pink whenever `paper-foo` is clicked.
|
||||
```
|
||||
|
||||
3. **At least one test for each bug fixed or feature added** as part of the pull request. Pull requests that fix bugs or add features without accompanying tests will not be considered.
|
||||
|
||||
If a proposed change contains multiple commits, please [squash commits](https://www.google.com/url?q=http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request) to as few as is necessary to succinctly express the change. A Polymer author can help you squash commits, so don’t be afraid to ask us if you need help with that!
|
|
@ -1,31 +0,0 @@
|
|||
{
|
||||
"name": "iron-scroll-target-behavior",
|
||||
"version": "1.0.6",
|
||||
"description": "Allows to define a scroller target",
|
||||
"private": true,
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"main": "iron-scroll-target-behavior.html",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"scroll"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-scroll-target-behavior.git"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-scroll-target-behavior",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
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-scroll-target-behavior using the document scrolling</title>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<link rel="import" href="../iron-scroll-target-behavior.html">
|
||||
<link rel="import" href="x-scrollable.html">
|
||||
|
||||
<style>
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body unresolved>
|
||||
|
||||
<x-scrollable scroll-target="document"></x-scrollable>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,51 +0,0 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
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-scroll-target-behavior using a scrolling region</title>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<link rel="import" href="../iron-scroll-target-behavior.html">
|
||||
<link rel="import" href="x-scrollable.html">
|
||||
|
||||
<style>
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#region {
|
||||
height: 50vh;
|
||||
overflow: auto;
|
||||
position: absolute;
|
||||
top: 25vh;
|
||||
left: 25vh;
|
||||
right: 25vh;
|
||||
box-shadow: 0 0 60px rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body unresolved>
|
||||
|
||||
<div id="region">
|
||||
<x-scrollable scroll-target="region"></x-scrollable>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue