mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
enable unified routing
This commit is contained in:
parent
2360213901
commit
154f6b5fd8
133 changed files with 6988 additions and 7112 deletions
|
@ -1,4 +1,100 @@
|
|||
define(['jqm'], function () {
|
||||
define(['jQuery'], function () {
|
||||
|
||||
jQuery.mobile = {};
|
||||
|
||||
(function ($, window, undefined) {
|
||||
|
||||
function parentWithClass(elem, className) {
|
||||
|
||||
while (!elem.classList || !elem.classList.contains(className)) {
|
||||
elem = elem.parentNode;
|
||||
|
||||
if (!elem) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return elem;
|
||||
}
|
||||
|
||||
$.extend($.mobile, {
|
||||
|
||||
// Place to store various widget extensions
|
||||
behaviors: {}
|
||||
});
|
||||
|
||||
// plugins
|
||||
$.fn.extend({
|
||||
// Enhance child elements
|
||||
enhanceWithin: function () {
|
||||
var index,
|
||||
widgetElements = {},
|
||||
that = this;
|
||||
|
||||
// Enhance widgets
|
||||
$.each($.mobile.widgets, function (name, constructor) {
|
||||
|
||||
// If initSelector not false find elements
|
||||
if (constructor.initSelector) {
|
||||
|
||||
// Filter elements that should not be enhanced based on parents
|
||||
var elements = that[0].querySelectorAll(constructor.initSelector);
|
||||
|
||||
// Enhance whatever is left
|
||||
if (elements.length > 0) {
|
||||
widgetElements[constructor.prototype.widgetName] = $(elements);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
for (index in widgetElements) {
|
||||
widgetElements[index][index]();
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery, this);
|
||||
|
||||
jQuery.mobile.widgets = {};
|
||||
|
||||
// plugins
|
||||
$.fn.extend({
|
||||
// Enhance child elements
|
||||
enhanceWithin: function () {
|
||||
var index,
|
||||
widgetElements = {},
|
||||
that = this;
|
||||
|
||||
// Enhance widgets
|
||||
$.each($.mobile.widgets, function (name, constructor) {
|
||||
|
||||
// If initSelector not false find elements
|
||||
if (constructor.initSelector) {
|
||||
|
||||
// Filter elements that should not be enhanced based on parents
|
||||
var elements = that[0].querySelectorAll(constructor.initSelector);
|
||||
|
||||
// Enhance whatever is left
|
||||
if (elements.length > 0) {
|
||||
widgetElements[constructor.prototype.widgetName] = $(elements);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
for (index in widgetElements) {
|
||||
widgetElements[index][index]();
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
// For backcompat remove in 1.5
|
||||
jQuery(document).on("create", function (event) {
|
||||
jQuery(event.target).enhanceWithin();
|
||||
});
|
||||
|
||||
/*!
|
||||
* jQuery UI Widget c0ab71056b936627e8a7821f03c044aec6280a40
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue