mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
move emby-webcomponents to components and reflect paths
This commit is contained in:
parent
e91cbf8438
commit
6ddc62857d
275 changed files with 20 additions and 20 deletions
43
src/components/require/requiretext.js
Normal file
43
src/components/require/requiretext.js
Normal file
|
@ -0,0 +1,43 @@
|
|||
define(function () {
|
||||
'use strict';
|
||||
|
||||
// hack to work around the server's auto-redirection feature
|
||||
var addRedirectPrevention = self.dashboardVersion != null && self.Dashboard && !self.AppInfo.isNativeApp;
|
||||
|
||||
return {
|
||||
|
||||
load: function (url, req, load, config) {
|
||||
|
||||
if (url.indexOf('://') === -1) {
|
||||
url = config.baseUrl + url;
|
||||
}
|
||||
|
||||
if (config.urlArgs) {
|
||||
url += config.urlArgs(url, url);
|
||||
}
|
||||
|
||||
if (addRedirectPrevention) {
|
||||
if (url.indexOf('?') === -1) {
|
||||
url += '?';
|
||||
} else {
|
||||
url += '&';
|
||||
}
|
||||
|
||||
url += 'r=0';
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url, true);
|
||||
|
||||
xhr.onload = function (e) {
|
||||
load(this.response);
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
},
|
||||
|
||||
normalize: function (name, normalize) {
|
||||
return normalize(name);
|
||||
}
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue