mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update live tv
This commit is contained in:
parent
693c99f275
commit
256b44764f
7 changed files with 174 additions and 98 deletions
|
@ -586,7 +586,8 @@ prevent = dy > dx;
|
||||||
prevent = dx > dy;
|
prevent = dx > dy;
|
||||||
}
|
}
|
||||||
if (prevent) {
|
if (prevent) {
|
||||||
ev.preventDefault();
|
// This prevents side scrolling in safari
|
||||||
|
//ev.preventDefault();
|
||||||
} else {
|
} else {
|
||||||
Gestures.prevent('track');
|
Gestures.prevent('track');
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,43 +18,33 @@
|
||||||
<div class="listTopPaging">
|
<div class="listTopPaging">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="items" class="itemsContainer"></div>
|
<div id="items" class="itemsContainer" style="max-width:800px;margin: 0 auto;"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-role="panel" class="viewPanel" data-theme="a" data-position="right" data-display="overlay" data-position-fixed="true">
|
<div data-role="panel" class="viewPanel" data-theme="a" data-position="right" data-display="overlay" data-position-fixed="true">
|
||||||
<form>
|
<form>
|
||||||
|
|
||||||
<div data-role="controlgroup" data-type="horizontal" data-mini="true" class="viewPanelTabs">
|
<div data-role="controlgroup" data-type="horizontal" data-mini="true" class="viewPanelTabs">
|
||||||
<a href="#" data-role="button" class="viewTabButton" data-tab="tabView">${TabView}</a>
|
<a href="#" data-role="button" class="viewTabButton" data-tab="tabView">${TabView}</a>
|
||||||
<a href="#" data-role="button" class="viewTabButton" data-tab="tabFilter">${TabFilter}</a>
|
<a href="#" data-role="button" class="viewTabButton" data-tab="tabFilter">${TabFilter}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tabView viewTab">
|
<div class="tabView viewTab">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label for="selectPageSize">${LabelPageSize}</label>
|
<label for="selectPageSize">${LabelPageSize}</label>
|
||||||
<select id="selectPageSize"></select>
|
<select id="selectPageSize"></select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="tabFilter viewTab">
|
<div class="tabFilter viewTab">
|
||||||
<fieldset data-role="controlgroup">
|
<fieldset data-role="controlgroup">
|
||||||
<legend>${HeaderFilters}</legend>
|
<legend>${HeaderFilters}</legend>
|
||||||
<input class="chkStandardFilter" type="checkbox" id="chkFavorite" data-filter="IsFavorite" data-mini="true">
|
<input class="chkStandardFilter" type="checkbox" id="chkFavorite" data-filter="IsFavorite" data-mini="true">
|
||||||
<label for="chkFavorite">${OptionFavorite}</label>
|
<label for="chkFavorite">${OptionFavorite}</label>
|
||||||
|
|
||||||
<input class="chkStandardFilter" type="checkbox" id="chkLikes" data-filter="Likes" data-mini="true">
|
<input class="chkStandardFilter" type="checkbox" id="chkLikes" data-filter="Likes" data-mini="true">
|
||||||
<label for="chkLikes">${OptionLikes}</label>
|
<label for="chkLikes">${OptionLikes}</label>
|
||||||
|
|
||||||
<input class="chkStandardFilter" type="checkbox" id="chkDislikes" data-filter="Dislikes" data-mini="true">
|
<input class="chkStandardFilter" type="checkbox" id="chkDislikes" data-filter="Dislikes" data-mini="true">
|
||||||
<label for="chkDislikes">${OptionDislikes}</label>
|
<label for="chkDislikes">${OptionDislikes}</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -2508,6 +2508,7 @@
|
||||||
var tooltipPlayed = Globalize.translate('TooltipPlayed');
|
var tooltipPlayed = Globalize.translate('TooltipPlayed');
|
||||||
|
|
||||||
if (item.MediaType == 'Video' || item.Type == 'Series' || item.Type == 'Season' || item.Type == 'BoxSet' || item.Type == 'Playlist') {
|
if (item.MediaType == 'Video' || item.Type == 'Series' || item.Type == 'Season' || item.Type == 'BoxSet' || item.Type == 'Playlist') {
|
||||||
|
if (item.Type != 'TvChannel') {
|
||||||
if (userData.Played) {
|
if (userData.Played) {
|
||||||
html += LibraryBrowser.getUserDataButtonHtml('markPlayed', itemId, 'btnUserItemRating btnUserItemRatingOn', 'check', tooltipPlayed);
|
html += LibraryBrowser.getUserDataButtonHtml('markPlayed', itemId, 'btnUserItemRating btnUserItemRatingOn', 'check', tooltipPlayed);
|
||||||
} else {
|
} else {
|
||||||
|
@ -2515,6 +2516,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var tooltipLike = Globalize.translate('TooltipLike');
|
var tooltipLike = Globalize.translate('TooltipLike');
|
||||||
var tooltipDislike = Globalize.translate('TooltipDislike');
|
var tooltipDislike = Globalize.translate('TooltipDislike');
|
||||||
|
|
|
@ -8,11 +8,9 @@
|
||||||
|
|
||||||
function getChannelsHtml(channels) {
|
function getChannelsHtml(channels) {
|
||||||
|
|
||||||
return LibraryBrowser.getPosterViewHtml({
|
return LibraryBrowser.getListViewHtml({
|
||||||
items: channels,
|
items: channels,
|
||||||
shape: "smallBackdrop",
|
smallIcon: true
|
||||||
centerText: true,
|
|
||||||
lazy: true
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +40,7 @@
|
||||||
var elem = page.querySelector('#items');
|
var elem = page.querySelector('#items');
|
||||||
elem.innerHTML = html;
|
elem.innerHTML = html;
|
||||||
ImageLoader.lazyChildren(elem);
|
ImageLoader.lazyChildren(elem);
|
||||||
|
$(elem).trigger('create');
|
||||||
|
|
||||||
$('.btnNextPage', page).on('click', function () {
|
$('.btnNextPage', page).on('click', function () {
|
||||||
query.StartIndex += query.Limit;
|
query.StartIndex += query.Limit;
|
||||||
|
|
|
@ -8,19 +8,19 @@
|
||||||
|
|
||||||
userId: Dashboard.getCurrentUserId(),
|
userId: Dashboard.getCurrentUserId(),
|
||||||
IsAiring: true,
|
IsAiring: true,
|
||||||
limit: 18
|
limit: 16
|
||||||
|
|
||||||
}).done(function (result) {
|
}).done(function (result) {
|
||||||
|
|
||||||
var html = LibraryBrowser.getPosterViewHtml({
|
var html = LibraryBrowser.getPosterViewHtml({
|
||||||
|
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
shape: "auto",
|
shape: "auto",
|
||||||
showTitle: true,
|
showTitle: true,
|
||||||
showParentTitle: true,
|
showParentTitle: true,
|
||||||
overlayText: true,
|
overlayText: true,
|
||||||
coverImage: true,
|
coverImage: true,
|
||||||
lazy: true
|
lazy: true,
|
||||||
|
overlayPlayButton: true
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
userId: Dashboard.getCurrentUserId(),
|
userId: Dashboard.getCurrentUserId(),
|
||||||
IsAiring: false,
|
IsAiring: false,
|
||||||
HasAired: false,
|
HasAired: false,
|
||||||
limit: 9,
|
limit: 8,
|
||||||
IsMovie: false,
|
IsMovie: false,
|
||||||
IsSports: false
|
IsSports: false
|
||||||
|
|
||||||
|
@ -56,7 +56,8 @@
|
||||||
showParentTitle: true,
|
showParentTitle: true,
|
||||||
overlayText: true,
|
overlayText: true,
|
||||||
coverImage: true,
|
coverImage: true,
|
||||||
lazy: true
|
lazy: true,
|
||||||
|
overlayMoreButton: true
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -70,7 +71,7 @@
|
||||||
userId: Dashboard.getCurrentUserId(),
|
userId: Dashboard.getCurrentUserId(),
|
||||||
IsAiring: false,
|
IsAiring: false,
|
||||||
HasAired: false,
|
HasAired: false,
|
||||||
limit: 9,
|
limit: 8,
|
||||||
IsMovie: true
|
IsMovie: true
|
||||||
|
|
||||||
}).done(function (result) {
|
}).done(function (result) {
|
||||||
|
@ -81,7 +82,8 @@
|
||||||
showTitle: false,
|
showTitle: false,
|
||||||
coverImage: true,
|
coverImage: true,
|
||||||
overlayText: false,
|
overlayText: false,
|
||||||
lazy: true
|
lazy: true,
|
||||||
|
overlayMoreButton: true
|
||||||
});
|
});
|
||||||
|
|
||||||
var elem = page.querySelector('.upcomingTvMovieItems');
|
var elem = page.querySelector('.upcomingTvMovieItems');
|
||||||
|
@ -94,7 +96,7 @@
|
||||||
userId: Dashboard.getCurrentUserId(),
|
userId: Dashboard.getCurrentUserId(),
|
||||||
IsAiring: false,
|
IsAiring: false,
|
||||||
HasAired: false,
|
HasAired: false,
|
||||||
limit: 9,
|
limit: 8,
|
||||||
IsSports: true
|
IsSports: true
|
||||||
|
|
||||||
}).done(function (result) {
|
}).done(function (result) {
|
||||||
|
@ -105,7 +107,8 @@
|
||||||
showTitle: false,
|
showTitle: false,
|
||||||
coverImage: true,
|
coverImage: true,
|
||||||
overlayText: false,
|
overlayText: false,
|
||||||
lazy: true
|
lazy: true,
|
||||||
|
overlayMoreButton: true
|
||||||
});
|
});
|
||||||
|
|
||||||
var elem = page.querySelector('.upcomingSportsItems');
|
var elem = page.querySelector('.upcomingSportsItems');
|
||||||
|
|
|
@ -407,7 +407,8 @@
|
||||||
centerText: true,
|
centerText: true,
|
||||||
context: 'channels',
|
context: 'channels',
|
||||||
lazy: true,
|
lazy: true,
|
||||||
showDetailsMenu: true
|
showDetailsMenu: true,
|
||||||
|
overlayPlayButton: true
|
||||||
});
|
});
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
|
@ -199,25 +199,30 @@ var DomModule = function () {
|
||||||
return document.createElement('dom-module');
|
return document.createElement('dom-module');
|
||||||
};
|
};
|
||||||
DomModule.prototype = Object.create(HTMLElement.prototype);
|
DomModule.prototype = Object.create(HTMLElement.prototype);
|
||||||
DomModule.prototype.constructor = DomModule;
|
Polymer.Base.extend(DomModule.prototype, {
|
||||||
DomModule.prototype.createdCallback = function () {
|
constructor: DomModule,
|
||||||
var id = this.id || this.getAttribute('name') || this.getAttribute('is');
|
createdCallback: function () {
|
||||||
|
this.register();
|
||||||
|
},
|
||||||
|
register: function (id) {
|
||||||
|
var id = id || this.id || this.getAttribute('name') || this.getAttribute('is');
|
||||||
if (id) {
|
if (id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
modules[id] = this;
|
modules[id] = this;
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
DomModule.prototype.import = function (id, slctr) {
|
import: function (id, selector) {
|
||||||
var m = modules[id];
|
var m = modules[id];
|
||||||
if (!m) {
|
if (!m) {
|
||||||
forceDocumentUpgrade();
|
forceDocumentUpgrade();
|
||||||
m = modules[id];
|
m = modules[id];
|
||||||
}
|
}
|
||||||
if (m && slctr) {
|
if (m && selector) {
|
||||||
m = m.querySelector(slctr);
|
m = m.querySelector(selector);
|
||||||
}
|
}
|
||||||
return m;
|
return m;
|
||||||
};
|
}
|
||||||
|
});
|
||||||
var cePolyfill = window.CustomElements && !CustomElements.useNative;
|
var cePolyfill = window.CustomElements && !CustomElements.useNative;
|
||||||
if (cePolyfill) {
|
if (cePolyfill) {
|
||||||
var ready = CustomElements.ready;
|
var ready = CustomElements.ready;
|
||||||
|
@ -513,7 +518,7 @@ _setupDebouncers: function () {
|
||||||
this._debouncers = {};
|
this._debouncers = {};
|
||||||
},
|
},
|
||||||
debounce: function (jobName, callback, wait) {
|
debounce: function (jobName, callback, wait) {
|
||||||
this._debouncers[jobName] = Polymer.Debounce.call(this, this._debouncers[jobName], callback, wait);
|
return this._debouncers[jobName] = Polymer.Debounce.call(this, this._debouncers[jobName], callback, wait);
|
||||||
},
|
},
|
||||||
isDebouncerActive: function (jobName) {
|
isDebouncerActive: function (jobName) {
|
||||||
var debouncer = this._debouncers[jobName];
|
var debouncer = this._debouncers[jobName];
|
||||||
|
@ -532,7 +537,7 @@ debouncer.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Polymer.version = '1.0.7';
|
Polymer.version = '1.0.8';
|
||||||
Polymer.Base._addFeature({
|
Polymer.Base._addFeature({
|
||||||
_registerFeatures: function () {
|
_registerFeatures: function () {
|
||||||
this._prepIs();
|
this._prepIs();
|
||||||
|
@ -972,7 +977,6 @@ var nativeRemoveChild = Element.prototype.removeChild;
|
||||||
var nativeAppendChild = Element.prototype.appendChild;
|
var nativeAppendChild = Element.prototype.appendChild;
|
||||||
var nativeCloneNode = Element.prototype.cloneNode;
|
var nativeCloneNode = Element.prototype.cloneNode;
|
||||||
var nativeImportNode = Document.prototype.importNode;
|
var nativeImportNode = Document.prototype.importNode;
|
||||||
var dirtyRoots = [];
|
|
||||||
var DomApi = function (node) {
|
var DomApi = function (node) {
|
||||||
this.node = node;
|
this.node = node;
|
||||||
if (this.patch) {
|
if (this.patch) {
|
||||||
|
@ -981,17 +985,12 @@ this.patch();
|
||||||
};
|
};
|
||||||
DomApi.prototype = {
|
DomApi.prototype = {
|
||||||
flush: function () {
|
flush: function () {
|
||||||
for (var i = 0, host; i < dirtyRoots.length; i++) {
|
Polymer.dom.flush();
|
||||||
host = dirtyRoots[i];
|
|
||||||
host.flushDebouncer('_distribute');
|
|
||||||
}
|
|
||||||
dirtyRoots = [];
|
|
||||||
},
|
},
|
||||||
_lazyDistribute: function (host) {
|
_lazyDistribute: function (host) {
|
||||||
if (host.shadyRoot && host.shadyRoot._distributionClean) {
|
if (host.shadyRoot && host.shadyRoot._distributionClean) {
|
||||||
host.shadyRoot._distributionClean = false;
|
host.shadyRoot._distributionClean = false;
|
||||||
host.debounce('_distribute', host._distributeContent);
|
Polymer.dom.addDebouncer(host.debounce('_distribute', host._distributeContent));
|
||||||
dirtyRoots.push(host);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
appendChild: function (node) {
|
appendChild: function (node) {
|
||||||
|
@ -1427,32 +1426,44 @@ configurable: true
|
||||||
},
|
},
|
||||||
textContent: {
|
textContent: {
|
||||||
get: function () {
|
get: function () {
|
||||||
if (this.node.nodeType === Node.TEXT_NODE) {
|
var nt = this.node.nodeType;
|
||||||
|
if (nt === Node.TEXT_NODE || nt === Node.COMMENT_NODE) {
|
||||||
return this.node.textContent;
|
return this.node.textContent;
|
||||||
} else {
|
} else {
|
||||||
return Array.prototype.map.call(this.childNodes, function (c) {
|
var tc = [];
|
||||||
return c.textContent;
|
for (var i = 0, cn = this.childNodes, c; c = cn[i]; i++) {
|
||||||
}).join('');
|
if (c.nodeType !== Node.COMMENT_NODE) {
|
||||||
|
tc.push(c.textContent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tc.join('');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
set: function (text) {
|
set: function (text) {
|
||||||
|
var nt = this.node.nodeType;
|
||||||
|
if (nt === Node.TEXT_NODE || nt === Node.COMMENT_NODE) {
|
||||||
|
this.node.textContent = text;
|
||||||
|
} else {
|
||||||
this._clear();
|
this._clear();
|
||||||
if (text) {
|
if (text) {
|
||||||
this.appendChild(document.createTextNode(text));
|
this.appendChild(document.createTextNode(text));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
configurable: true
|
configurable: true
|
||||||
},
|
},
|
||||||
innerHTML: {
|
innerHTML: {
|
||||||
get: function () {
|
get: function () {
|
||||||
if (this.node.nodeType === Node.TEXT_NODE) {
|
var nt = this.node.nodeType;
|
||||||
|
if (nt === Node.TEXT_NODE || nt === Node.COMMENT_NODE) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return getInnerHTML(this.node);
|
return getInnerHTML(this.node);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
set: function (text) {
|
set: function (text) {
|
||||||
if (this.node.nodeType !== Node.TEXT_NODE) {
|
var nt = this.node.nodeType;
|
||||||
|
if (nt !== Node.TEXT_NODE || nt !== Node.COMMENT_NODE) {
|
||||||
this._clear();
|
this._clear();
|
||||||
var d = document.createElement('div');
|
var d = document.createElement('div');
|
||||||
d.innerHTML = text;
|
d.innerHTML = text;
|
||||||
|
@ -1565,7 +1576,43 @@ return Polymer.EventApi.factory(obj);
|
||||||
return factory(obj, patch);
|
return factory(obj, patch);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Polymer.dom.flush = DomApi.prototype.flush;
|
Polymer.Base.extend(Polymer.dom, {
|
||||||
|
_flushGuard: 0,
|
||||||
|
_FLUSH_MAX: 100,
|
||||||
|
_needsTakeRecords: !Polymer.Settings.useNativeCustomElements,
|
||||||
|
_debouncers: [],
|
||||||
|
_finishDebouncer: null,
|
||||||
|
flush: function () {
|
||||||
|
for (var i = 0; i < this._debouncers.length; i++) {
|
||||||
|
this._debouncers[i].complete();
|
||||||
|
}
|
||||||
|
if (this._finishDebouncer) {
|
||||||
|
this._finishDebouncer.complete();
|
||||||
|
}
|
||||||
|
this._flushPolyfills();
|
||||||
|
if (this._debouncers.length && this._flushGuard < this._FLUSH_MAX) {
|
||||||
|
this._flushGuard++;
|
||||||
|
this.flush();
|
||||||
|
} else {
|
||||||
|
if (this._flushGuard >= this._FLUSH_MAX) {
|
||||||
|
console.warn('Polymer.dom.flush aborted. Flush may not be complete.');
|
||||||
|
}
|
||||||
|
this._flushGuard = 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_flushPolyfills: function () {
|
||||||
|
if (this._needsTakeRecords) {
|
||||||
|
CustomElements.takeRecords();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addDebouncer: function (debouncer) {
|
||||||
|
this._debouncers.push(debouncer);
|
||||||
|
this._finishDebouncer = Polymer.Debounce(this._finishDebouncer, this._finishFlush);
|
||||||
|
},
|
||||||
|
_finishFlush: function () {
|
||||||
|
Polymer.dom._debouncers = [];
|
||||||
|
}
|
||||||
|
});
|
||||||
function getLightChildren(node) {
|
function getLightChildren(node) {
|
||||||
var children = node._lightChildren;
|
var children = node._lightChildren;
|
||||||
return children ? children : node.childNodes;
|
return children ? children : node.childNodes;
|
||||||
|
@ -1691,6 +1738,7 @@ this.shadyRoot._dirtyRoots = [];
|
||||||
},
|
},
|
||||||
_finishDistribute: function () {
|
_finishDistribute: function () {
|
||||||
if (this._useContent) {
|
if (this._useContent) {
|
||||||
|
this.shadyRoot._distributionClean = true;
|
||||||
if (hasInsertionPoint(this.shadyRoot)) {
|
if (hasInsertionPoint(this.shadyRoot)) {
|
||||||
this._composeTree();
|
this._composeTree();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1704,7 +1752,6 @@ this._updateChildNodes(this, children);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.shadyRoot._hasDistributed = true;
|
this.shadyRoot._hasDistributed = true;
|
||||||
this.shadyRoot._distributionClean = true;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
elementMatches: function (selector, node) {
|
elementMatches: function (selector, node) {
|
||||||
|
@ -2502,6 +2549,16 @@ var recognizers = Gestures.recognizers;
|
||||||
for (var i = 0, r; i < recognizers.length; i++) {
|
for (var i = 0, r; i < recognizers.length; i++) {
|
||||||
r = recognizers[i];
|
r = recognizers[i];
|
||||||
if (gs[r.name] && !handled[r.name]) {
|
if (gs[r.name] && !handled[r.name]) {
|
||||||
|
if (r.flow && r.flow.start.indexOf(ev.type) > -1) {
|
||||||
|
if (r.reset) {
|
||||||
|
r.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (var i = 0, r; i < recognizers.length; i++) {
|
||||||
|
r = recognizers[i];
|
||||||
|
if (gs[r.name] && !handled[r.name]) {
|
||||||
handled[r.name] = true;
|
handled[r.name] = true;
|
||||||
r[type](ev);
|
r[type](ev);
|
||||||
}
|
}
|
||||||
|
@ -2532,8 +2589,10 @@ prevent = dy > dx;
|
||||||
prevent = dx > dy;
|
prevent = dx > dy;
|
||||||
}
|
}
|
||||||
if (prevent) {
|
if (prevent) {
|
||||||
//This breaks scrolling in safari
|
// This prevents side scrolling in safari
|
||||||
//ev.preventDefault();
|
//ev.preventDefault();
|
||||||
|
} else {
|
||||||
|
Gestures.prevent('track');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -2675,6 +2734,16 @@ deps: [
|
||||||
'touchmove',
|
'touchmove',
|
||||||
'touchend'
|
'touchend'
|
||||||
],
|
],
|
||||||
|
flow: {
|
||||||
|
start: [
|
||||||
|
'mousedown',
|
||||||
|
'touchstart'
|
||||||
|
],
|
||||||
|
end: [
|
||||||
|
'mouseup',
|
||||||
|
'touchend'
|
||||||
|
]
|
||||||
|
},
|
||||||
emits: ['track'],
|
emits: ['track'],
|
||||||
info: {
|
info: {
|
||||||
x: 0,
|
x: 0,
|
||||||
|
@ -2690,7 +2759,7 @@ this.moves.push(move);
|
||||||
},
|
},
|
||||||
prevent: false
|
prevent: false
|
||||||
},
|
},
|
||||||
clearInfo: function () {
|
reset: function () {
|
||||||
this.info.state = 'start';
|
this.info.state = 'start';
|
||||||
this.info.started = false;
|
this.info.started = false;
|
||||||
this.info.moves = [];
|
this.info.moves = [];
|
||||||
|
@ -2729,7 +2798,6 @@ if (self.info.started) {
|
||||||
Gestures.prevent('tap');
|
Gestures.prevent('tap');
|
||||||
movefn(e);
|
movefn(e);
|
||||||
}
|
}
|
||||||
self.clearInfo();
|
|
||||||
document.removeEventListener('mousemove', movefn);
|
document.removeEventListener('mousemove', movefn);
|
||||||
document.removeEventListener('mouseup', upfn);
|
document.removeEventListener('mouseup', upfn);
|
||||||
};
|
};
|
||||||
|
@ -2769,7 +2837,6 @@ y: ct.clientY
|
||||||
});
|
});
|
||||||
this.fire(t, ct);
|
this.fire(t, ct);
|
||||||
}
|
}
|
||||||
this.clearInfo();
|
|
||||||
},
|
},
|
||||||
fire: function (target, touch) {
|
fire: function (target, touch) {
|
||||||
var secondlast = this.info.moves[this.info.moves.length - 2];
|
var secondlast = this.info.moves[this.info.moves.length - 2];
|
||||||
|
@ -2804,6 +2871,16 @@ deps: [
|
||||||
'touchstart',
|
'touchstart',
|
||||||
'touchend'
|
'touchend'
|
||||||
],
|
],
|
||||||
|
flow: {
|
||||||
|
start: [
|
||||||
|
'mousedown',
|
||||||
|
'touchstart'
|
||||||
|
],
|
||||||
|
end: [
|
||||||
|
'click',
|
||||||
|
'touchend'
|
||||||
|
]
|
||||||
|
},
|
||||||
emits: ['tap'],
|
emits: ['tap'],
|
||||||
info: {
|
info: {
|
||||||
x: NaN,
|
x: NaN,
|
||||||
|
@ -2844,7 +2921,6 @@ sourceEvent: e
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.reset();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var DIRECTION_MAP = {
|
var DIRECTION_MAP = {
|
||||||
|
@ -3541,7 +3617,12 @@ this._effectEffects('__static__', null, this._propertyEffects.__static__);
|
||||||
});
|
});
|
||||||
Polymer.Base._addFeature({
|
Polymer.Base._addFeature({
|
||||||
_setupConfigure: function (initialConfig) {
|
_setupConfigure: function (initialConfig) {
|
||||||
this._config = initialConfig || {};
|
this._config = {};
|
||||||
|
for (var i in initialConfig) {
|
||||||
|
if (initialConfig[i] !== undefined) {
|
||||||
|
this._config[i] = initialConfig[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
this._handlers = [];
|
this._handlers = [];
|
||||||
},
|
},
|
||||||
_marshalAttributes: function () {
|
_marshalAttributes: function () {
|
||||||
|
@ -3670,8 +3751,9 @@ var array;
|
||||||
var last = parts[parts.length - 1];
|
var last = parts[parts.length - 1];
|
||||||
if (parts.length > 1) {
|
if (parts.length > 1) {
|
||||||
for (var i = 0; i < parts.length - 1; i++) {
|
for (var i = 0; i < parts.length - 1; i++) {
|
||||||
prop = prop[parts[i]];
|
var part = parts[i];
|
||||||
if (array) {
|
prop = prop[part];
|
||||||
|
if (array && parseInt(part) == part) {
|
||||||
parts[i] = Polymer.Collection.get(array).getKey(prop);
|
parts[i] = Polymer.Collection.get(array).getKey(prop);
|
||||||
}
|
}
|
||||||
if (!prop) {
|
if (!prop) {
|
||||||
|
@ -3679,15 +3761,13 @@ return;
|
||||||
}
|
}
|
||||||
array = Array.isArray(prop) ? prop : null;
|
array = Array.isArray(prop) ? prop : null;
|
||||||
}
|
}
|
||||||
if (array) {
|
if (array && parseInt(last) == last) {
|
||||||
var coll = Polymer.Collection.get(array);
|
var coll = Polymer.Collection.get(array);
|
||||||
var old = prop[last];
|
var old = prop[last];
|
||||||
var key = coll.getKey(old);
|
var key = coll.getKey(old);
|
||||||
if (key) {
|
|
||||||
parts[i] = key;
|
parts[i] = key;
|
||||||
coll.setItem(key, value);
|
coll.setItem(key, value);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
prop[last] = value;
|
prop[last] = value;
|
||||||
if (!root) {
|
if (!root) {
|
||||||
this.notifyPath(parts.join('.'), value);
|
this.notifyPath(parts.join('.'), value);
|
||||||
|
@ -4783,6 +4863,7 @@ Polymer.Base._addFeature({
|
||||||
_prepStyleProperties: function () {
|
_prepStyleProperties: function () {
|
||||||
this._ownStylePropertyNames = this._styles ? propertyUtils.decorateStyles(this._styles) : [];
|
this._ownStylePropertyNames = this._styles ? propertyUtils.decorateStyles(this._styles) : [];
|
||||||
},
|
},
|
||||||
|
customStyle: {},
|
||||||
_setupStyleProperties: function () {
|
_setupStyleProperties: function () {
|
||||||
this.customStyle = {};
|
this.customStyle = {};
|
||||||
},
|
},
|
||||||
|
@ -5014,15 +5095,8 @@ styleTransformer.documentRule(rule);
|
||||||
}());
|
}());
|
||||||
Polymer.Templatizer = {
|
Polymer.Templatizer = {
|
||||||
properties: { __hideTemplateChildren__: { observer: '_showHideChildren' } },
|
properties: { __hideTemplateChildren__: { observer: '_showHideChildren' } },
|
||||||
_templatizerStatic: {
|
|
||||||
count: 0,
|
|
||||||
callbacks: {},
|
|
||||||
debouncer: null
|
|
||||||
},
|
|
||||||
_instanceProps: Polymer.nob,
|
_instanceProps: Polymer.nob,
|
||||||
created: function () {
|
_parentPropPrefix: '_parent_',
|
||||||
this._templatizerId = this._templatizerStatic.count++;
|
|
||||||
},
|
|
||||||
templatize: function (template) {
|
templatize: function (template) {
|
||||||
if (!template._content) {
|
if (!template._content) {
|
||||||
template._content = template.content;
|
template._content = template.content;
|
||||||
|
@ -5066,20 +5140,10 @@ n.__hideTemplateChildren__ = hide;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_debounceTemplate: function (fn) {
|
_debounceTemplate: function (fn) {
|
||||||
this._templatizerStatic.callbacks[this._templatizerId] = fn.bind(this);
|
Polymer.dom.addDebouncer(this.debounce('_debounceTemplate', fn));
|
||||||
this._templatizerStatic.debouncer = Polymer.Debounce(this._templatizerStatic.debouncer, this._flushTemplates.bind(this, true));
|
|
||||||
},
|
},
|
||||||
_flushTemplates: function (debouncerExpired) {
|
_flushTemplates: function (debouncerExpired) {
|
||||||
var db = this._templatizerStatic.debouncer;
|
Polymer.dom.flush();
|
||||||
while (debouncerExpired || db && db.finish) {
|
|
||||||
db.stop();
|
|
||||||
var cbs = this._templatizerStatic.callbacks;
|
|
||||||
this._templatizerStatic.callbacks = {};
|
|
||||||
for (var id in cbs) {
|
|
||||||
cbs[id]();
|
|
||||||
}
|
|
||||||
debouncerExpired = false;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
_customPrepEffects: function (archetype) {
|
_customPrepEffects: function (archetype) {
|
||||||
var parentProps = archetype._parentProps;
|
var parentProps = archetype._parentProps;
|
||||||
|
@ -5119,7 +5183,7 @@ if (template != this) {
|
||||||
Polymer.Bind.prepareModel(proto);
|
Polymer.Bind.prepareModel(proto);
|
||||||
}
|
}
|
||||||
for (prop in parentProps) {
|
for (prop in parentProps) {
|
||||||
var parentProp = '_parent_' + prop;
|
var parentProp = this._parentPropPrefix + prop;
|
||||||
var effects = [
|
var effects = [
|
||||||
{
|
{
|
||||||
kind: 'function',
|
kind: 'function',
|
||||||
|
@ -5143,8 +5207,9 @@ this._forwardParentProp(prop, value);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
_createHostPropEffector: function (prop) {
|
_createHostPropEffector: function (prop) {
|
||||||
|
var prefix = this._parentPropPrefix;
|
||||||
return function (source, value) {
|
return function (source, value) {
|
||||||
this.dataHost['_parent_' + prop] = value;
|
this.dataHost[prefix + prop] = value;
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
_createInstancePropEffector: function (prop) {
|
_createInstancePropEffector: function (prop) {
|
||||||
|
@ -5176,12 +5241,12 @@ var dot = path.indexOf('.');
|
||||||
var root = dot < 0 ? path : path.slice(0, dot);
|
var root = dot < 0 ? path : path.slice(0, dot);
|
||||||
dataHost._forwardInstancePath.call(dataHost, this, path, value);
|
dataHost._forwardInstancePath.call(dataHost, this, path, value);
|
||||||
if (root in dataHost._parentProps) {
|
if (root in dataHost._parentProps) {
|
||||||
dataHost.notifyPath('_parent_' + path, value);
|
dataHost.notifyPath(dataHost._parentPropPrefix + path, value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_pathEffector: function (path, value, fromAbove) {
|
_pathEffector: function (path, value, fromAbove) {
|
||||||
if (this._forwardParentPath) {
|
if (this._forwardParentPath) {
|
||||||
if (path.indexOf('_parent_') === 0) {
|
if (path.indexOf(this._parentPropPrefix) === 0) {
|
||||||
this._forwardParentPath(path.substring(8), value);
|
this._forwardParentPath(path.substring(8), value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5229,7 +5294,7 @@ stamp: function (model) {
|
||||||
model = model || {};
|
model = model || {};
|
||||||
if (this._parentProps) {
|
if (this._parentProps) {
|
||||||
for (var prop in this._parentProps) {
|
for (var prop in this._parentProps) {
|
||||||
model[prop] = this['_parent_' + prop];
|
model[prop] = this[this._parentPropPrefix + prop];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new this.ctor(model, this);
|
return new this.ctor(model, this);
|
||||||
|
@ -5945,7 +6010,16 @@ Polymer({
|
||||||
is: 'dom-bind',
|
is: 'dom-bind',
|
||||||
extends: 'template',
|
extends: 'template',
|
||||||
created: function () {
|
created: function () {
|
||||||
Polymer.ImportStatus.whenLoaded(this._readySelf.bind(this));
|
Polymer.ImportStatus.whenLoaded(this._markImportsReady.bind(this));
|
||||||
|
},
|
||||||
|
_ensureReady: function () {
|
||||||
|
if (!this._readied) {
|
||||||
|
this._readySelf();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_markImportsReady: function () {
|
||||||
|
this._importsReady = true;
|
||||||
|
this._ensureReady();
|
||||||
},
|
},
|
||||||
_registerFeatures: function () {
|
_registerFeatures: function () {
|
||||||
this._prepConstructor();
|
this._prepConstructor();
|
||||||
|
@ -5978,6 +6052,15 @@ config[prop] = this[prop];
|
||||||
this._setupConfigure = this._setupConfigure.bind(this, config);
|
this._setupConfigure = this._setupConfigure.bind(this, config);
|
||||||
},
|
},
|
||||||
attached: function () {
|
attached: function () {
|
||||||
|
if (this._importsReady) {
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
detached: function () {
|
||||||
|
this._removeChildren();
|
||||||
|
},
|
||||||
|
render: function () {
|
||||||
|
this._ensureReady();
|
||||||
if (!this._children) {
|
if (!this._children) {
|
||||||
this._template = this;
|
this._template = this;
|
||||||
this._prepAnnotations();
|
this._prepAnnotations();
|
||||||
|
@ -5990,9 +6073,6 @@ this._children = Array.prototype.slice.call(this.root.childNodes);
|
||||||
}
|
}
|
||||||
this._insertChildren();
|
this._insertChildren();
|
||||||
this.fire('dom-change');
|
this.fire('dom-change');
|
||||||
},
|
|
||||||
detached: function () {
|
|
||||||
this._removeChildren();
|
|
||||||
}
|
}
|
||||||
});</script>
|
});</script>
|
||||||
<style is="custom-style">
|
<style is="custom-style">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue